Why does my low activity install need 2GB RAM?


(qwerty) #1

Definitely needs at least 2 G. Tried over various sizes, and always chews up at least 1G, especially with more users hitting forum.

1008924 used

Does the server need 2GB of RAM?
Does the server need 2GB of RAM?
(Jeff Atwood) #2

What are the stats on your /about page please?


(Matt Palmer) #3

Also: how much swap have you configured, how many unicorn workers, and what is actually consuming all your RAM?


(qwerty) #4

Swap is 2G disk, however if the box starts swapping the user experience is shot anyways.

          all  7d  30d
Topics	  227 	0	 5
Posts	12.2k	5	47
Users	  544  	5	18
Active      —  18	48
Likes	  225   0   10

Been troubleshooting issues with 5xx returned from nginx. Only thing that helped was increase of RAM to 2G.

[error] 65#65: *3154573 upstream prematurely closed connection while reading response header from upstream

(qwerty) #5

Pretty much all default settings, and it’s ruby/redis chewing everything up.

 1868 ubuntu    20   0   31944   5772   3412 S  0.3  0.3   0:01.23 unicorn_launche                                                                                                       
 1884 ubuntu    20   0  423900 155132  21684 S  0.3  7.6   0:05.81 ruby                                                                                                                  
 2094 ubuntu    20   0  491728 185996  11300 S  0.3  9.1   0:04.97 ruby                                                                                                                  
 2117 ubuntu    20   0 1634612 276584  25500 S  0.3 13.5   0:06.60 ruby 
 2127 ubuntu    20   0 1634612 273080  21944 S  0.3 13.3   0:06.16 ruby

(Jeff Atwood) #6

Are you using weirdo plugins? That is not a very high user, topic, or post count.

And swap was configured?


(qwerty) #7

no plugins at all, and 2g swap is configured yes, but that wont help at all.


(Jeff Atwood) #8

Something is deeply wrong with your install. I have much more active sites than that on 1gb ram and they do fine.


(Matt Palmer) #9

Swap activity kills user experience; stuffing a bunch of pages that nobody ever looks at onto disk is a good thing.

That usually means “a unicorn worker exploded”. What’s in the unicorn stdout/stderr logs for around that time?

Your redis may be yuuuuuge, but it’s not in that top output so we can’t really tell. Do you need four unicorn workers? Winding it back a bit will save you some RAM.


(qwerty) #10

@mpalmer this is pretty much default configuration install, and yes have just run ./launcher rebuild for latest build.

# grep -i unicorn app.yml 
UNICORN_WORKERS: 2

That usually means “a unicorn worker exploded”. What’s in the unicorn stdout/stderr logs for around that time?

Where can i get the logs from ? ‘docker logs xxx’ doesn’t give anything useful.


(Matt Palmer) #11

:raised_eyebrow:

Why, then, are there four ruby processes running? What are the full commands of each of them?

/var/discourse/shared/app/log/rails/unicorn.std{out,err}.log.


(qwerty) #12

Something is deeply wrong with your install. I have much more active sites than that on 1gb ram and they do fine.

ubuntu 16.04, with no addtional packages or services running. Maybe you have a reference .yml config to review?


(qwerty) #13

Why, then, are there four ruby processes running? What are the full commands of each of them?

2 workers, 2 masters

/var/discourse/shared/app/log/rails/unicorn.std{out,err}.log.

nothing in this dir at all. this is default location? does logging need to be enabled?


(qwerty) #14

/var/discourse/shared/standalone/log/var-log


(Matt Palmer) #15

There shouldn’t be two masters. Something is deeply wrong with your install.

That is the default location. The app may be different (it is taken from the name of the container .yml file), but otherwise, something is deeply wrong with your install.


(qwerty) #16

Ahhh it’s not 2 masters, it’s 1 master and 1 launcher.

ubuntu    1868  1863  0 Jun29 ?        00:00:02 /bin/bash config/unicorn_launcher -E production -c config/unicorn.conf.rb
ubuntu    1884  1868  0 Jun29 ?        00:00:06 unicorn master -E production -c config/unicorn.conf.rb
ubuntu    2117  1884  0 Jun29 ?        00:00:09 unicorn worker[0] -E production -c config/unicorn.conf.rb
ubuntu    2127  1884  0 Jun29 ?        00:00:08 unicorn worker[1] -E production -c config/unicorn.conf.rb

You guys keep saying something is deeply wrong with install, but this is using all default configuration., please advise what in the default configuration is wrong ?


(Matt Palmer) #17

Nothing that we’re aware of is wrong in the default configuration. What you’re telling us about your installation indicates something is wrong – either in your install, or in what you’re telling us. Persistently not giving us the full picture makes it impossible to determine exactly what’s going wrong, so I’m going to bow out of this conversation.


(Jeff Atwood) #18

Maybe if you could share output from

df -m
free -m

and a screenshot of htop on a reasonably sized console?


(Joffrey Jaffeux) #19

Keep talking please, so much goodness to add into discourse-doctor :grin:


(Andrew Waugh) #20

@Omar_Samad,

Is your Discourse an import, or a restore from a test install, or did it start out empty?

If you’ve got imported posts which are too large, or otherwise cause problems with sidekiq jobs then you might be consuming RAM with that.

Also, are you carrying the restore schema around? See here.