Memory Useage Tips

(Jeron Paraiso) #1

Hi, thanks in advance for your help. This is a great community!

We have an instance of discourse running for a pretty small community (a few hundred active people maybe). We have it running on Amazon in a docker container, and lately have been experiencing out of memory issues when trying to post pictures. Users see it as just forever “Uploading”.

There is 2GB allocated for Discourse, and in looking at free space, we are ranging from 100mb - 200mb. The image problems tend to start appearing when the free memory gets down to about 100 mb.

Is this normal? Are there any thing to look out for in terms of types of activities that might cause memory useage to soar?

(Gerhard Schlager) #2

Do you have a swap file?

(Jeron Paraiso) #3

No we don’t, but we could.

Before that though, I’m curious. Might there be some issue such that adding more memory or a swap file is just “Patching” a misuse or bug in our setup? Is our memory usage normal for having a few hundred active users? I’ve been looking at/tailing the logs; is there any other ways to garner this info?

"Cannot allocate memory" when upgrading
(Kane York) #4

Yeah, that memory usage looks normal. Having a swap file will allow Discourse to fork and exec the image processing.

(Jeron Paraiso) #5

This issue just popped up again for us. This is the exact error message when uploading images from the logs:
Job exception: Cannot allocate memory - convert

Again, it manifests as forever “Uploading”

When we run free -m, this is what we see:
total used free shared buffers cached
Mem: 2000 1747 253 1 22 63
-/+ buffers/cache: 1661 338
Swap: 0 0 0

Therefore I doubt a swapfile will help. Any other ideas we could try? Or can lack of swap cause symptoms at that level of free memory?

(Rafael dos Santos Silva) #6

Swap ins’t recommended anymore, it’s necessary on 2GB servers.