Memory Usage and Blank Pages


(Adam Capriola) #1

I’ve had an intermittent issue with my Discourse install where all I see is a blank page when I try to visit it. If I sudo reboot everything goes back to normal. This has been happening probably about once per week. I’m on the Digital Ocean 2 GB RAM plan and my community is on the smaller end (I think – I’m not sure how community size is defined).

Anyway, have a feeling the problem is related to the memory usage. The past two times I’ve had to reboot here were the stats:

System load: 0.54
Usage of /: 80.5% of 39.25 GB
Memory usage: 79%
Swap usage: 93%
Processes: 124
System load: 0.03
Usage of /: 79.9% of 39.25 GB
Memory usage: 78%
Swap usage: 56%
Processes: 118

Does that look normal? Is there a possibility I have something misconfigured? I am more than happy to provide more information if needed.


Memory is running out and Discourse stops working
Memory is running out and Discourse stops working
(Jeff Atwood) #2

How big is your swap file? 93% swap usage is not good, no.


(Adam Capriola) #3

1 GB. I had followed your instructions here a few months back:

I thought it would be a good idea to create one, but maybe it’s not necessary?


(Dean Taylor) #4

@AdamCapriola I checked your stats (for BBS) and managed to find one of my Discourse installs that pretty closely matches your daily activity (but many times the size overall topics / posts wise) and also on a Digital Ocean 2GB plan.

Here are my stats:

  System load:  0.26
  Usage of /:   61.0% of 39.25GB
  Memory usage: 72%
  Swap usage:   15%

I have a 2GB swapfile file though.

I would say also that you should watch that free space, coming within 10-20% of free has an impact.

I am a couple of days behind on Discourse updates on this install though.


(Dean Taylor) #5

@AdamCapriola I can see you just posted this:

Currently I am not making requests this way on my Discourse install - this is a difference.

I would also suggest caching requests like this even if it’s just for a 10-30 seconds to reduce the impact on the Discourse install, you can use wp set_transient / get_transient in WordPress for this.


(Adam Capriola) #6

Good catch! I’ll look into limiting those requests and see if that helps.


(Jeff Atwood) #7

Try also cleaning up old Docker containers. That will free up disk space.


(Dean Taylor) #8

I haven’t tested this - but consider checking out this post re. clean up:
https://meta.discourse.org/t/low-on-disk-space-cleaning-up-old-docker-containers/15792/18?u=deanmarktaylor&source_topic_id=24511

I don’t think @sam’s launcher cleanup idea is in yet
https://meta.discourse.org/t/low-on-disk-space-cleaning-up-old-docker-containers/15792/19?u=deanmarktaylor&source_topic_id=24511


(Jeff Atwood) #9

That is nice, but I have used the “old” cleanup command dozens of times (albeit on the single container install) with zero problems.


(Sam Saffron) #10

You still need to dig it up… you can’t just do ./launcher --help to figure it out.

./launcher cleanup would be nice.


(Jeff Atwood) #11