Linode 360, 360Mb of RAM and only 54Mb free...

Hi,

I'm running a Linode 360 using CentOS 64 bit.

I know that 64bit requires more ram but I can't belive that I have only 54Mb of free ram.

If I cat /proc/meminfo

this commend tell me that there is 360Mb of available ram and 54Mb free…

I'm running ONLY

  • Apache + mysql + php

  • Postfix + dovecot + spamassassin + clamav + amavid

  • sshd

  • iptables

with the web site that is not serving any web page.

Something should be wrong.

Please help.

12 Replies

See:

http://www.linode.com/forums/viewtopic.php?t=4199

Which points to this:

http://chrisjohnston.org/2009/why-on-li … -ram-usage">http://chrisjohnston.org/2009/why-on-linux-am-i-seeing-so-much-ram-usage

I'm running Debian 5.0 32 bit, I've only installed Lighttpd and a few other things. I have about 16MB "free", but only 4K of swap is currently being used.

But if I run free -m I see that I really have 332MB and pretty much nothing in Swap.

             total       used       free     shared    buffers     cached
Mem:           360        343         16          0          8        307
-/+ buffers/cache:         27        332
Swap:          255          0        255

If you're server starts getting a lot of traffic, I'd take a look at using 32bit and not using Apache.

My system is using a little more memory, yet is still healthy (in my opinion):

rtucker@framboise:~$ free -m
             total       used       free     shared    buffers     cached
Mem:           348        332         15          0         68         97
-/+ buffers/cache:        167        181
Swap:          255         66        189

In this case, I have 181MB of physical memory free and am using 66MB of swap, which is pretty reasonable. Swap isn't necessarily bad.

What does the output of "ps aux" look like? That will display all the processes running, along with the amount of total memory and physical memory allocated to each process. You can add the "–sort=-rss" option to put the largest users first:

rtucker@framboise:~$ ps aux --sort=-rss
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
www-data 14532  0.0  6.0  46248 21516 ?        S    03:42   0:03 /usr/bin/php-cgi
www-data 14535  0.0  4.8  39832 17424 ?        S    03:42   0:03 /usr/bin/php-cgi
asterisk 20232  0.0  4.0  43740 14572 ?        S    May14   0:09 /usr/bin/php-cgi
www-data 14533  0.0  3.9  40336 14060 ?        S    03:42   0:03 /usr/bin/php-cgi
www-data 14534  0.0  3.6  39032 13076 ?        S    03:42   0:03 /usr/bin/php-cgi
rtucker   4396  0.0  3.5  23688 12856 pts/1    S+   May06   5:29 irssi
asterisk 20231  0.0  3.1  39420 11240 ?        S    May14   0:08 /usr/bin/php-cgi
mysql     2934  0.0  2.8  55376 10156 ?        Sl   May06   3:21 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
asterisk 26186  0.0  1.8  33352  6752 ?        Ssl  May17   0:26 /usr/sbin/asterisk -U asterisk
...

On my system, the "biggest users" of physical memory are php-cgi, irssi, mysqld, and asterisk. None of these are particular surprises :-)

The reason I've got so much free is because I really only have Lighttpd installed and not much else yet on top of what's already installed with Debian Lenny…. No mysql, no php-cgi….

Not even serving any content up yet. Just playing and testing right now in preparation for moving my sites over to Linode.

ok, I divided my prefork value by two and now I have

quite double of ram.

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
 <ifmodule prefork.c="">StartServers       4
MinSpareServers    2
MaxSpareServers   10
ServerLimit      128
MaxClients       128
MaxRequestsPerChild  2000</ifmodule> 

do you think that is good now?

free -m
             total       used       free     shared    buffers     cached
Mem:           360        355          4          0          4         92
-/+ buffers/cache:        259        100
Swap:          255          0        255

I'd say 100MB free is pretty danged good, given 64-bit and the collection of stuff you're running. If you start getting heavy traffic, you might need to reduce MaxClients (this is a common cause for servers "crashing" under the load of slashdot/digg/reddit/whatever).

You'll probably see swap usage start creeping up as things run awhile. This is normal, and is a Good Thing. The amount of +/- buffers/cache free minus the amount of swap used should hopefully stay around 100MB and should never approach zero. (Unless, of course, you're looking at my workstation.)

@hoopycat:

I'd say 100MB free is pretty danged good, given 64-bit and the collection of stuff you're running. If you start getting heavy traffic, you might need to reduce MaxClients (this is a common cause for servers "crashing" under the load of slashdot/digg/reddit/whatever).

You'll probably see swap usage start creeping up as things run awhile. This is normal, and is a Good Thing. The amount of +/- buffers/cache free minus the amount of swap used should hopefully stay around 100MB and should never approach zero. (Unless, of course, you're looking at my workstation.)

100MB is really a lot of memory if I calculate this value by

free memory minus used swap, are you sure that this is a hopefully value?

after some heavy heavy load now I have 30MB of free ram and 2 Mb of swap.

reading this guide:

http://chrisjohnston.org/2009/why-on-li … -ram-usage">http://chrisjohnston.org/2009/why-on-linux-am-i-seeing-so-much-ram-usage

it seems that the best command to see how much memory free is to run:

vmstat -aS

this commands tell the inactive memory that should approximate well the free physical memory.

I simply disabled clam daemon since it requires about 100Mb of RAM and I really don't need it.

I configured prefork in a RAGE manner and now I have

180Mb of free ram with all service running and Java client attached and working.

@sblantipodi:

I simply disabled clam daemon since it requires about 100Mb of RAM and I really don't need it.

I configured prefork in a RAGE manner and now I have

180Mb of free ram with all service running and Java client attached and working.

I doubt it actually uses 100 megs of ram

@OverlordQ:

@sblantipodi:

I simply disabled clam daemon since it requires about 100Mb of RAM and I really don't need it.

I configured prefork in a RAGE manner and now I have

180Mb of free ram with all service running and Java client attached and working.

I doubt it actually uses 100 megs of ram

80 for 32bit os.

@OverlordQ:

I doubt it actually uses 100 megs of ram

$ ps u -C clamd
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
clamav   24167  0.0 29.8 148700 105084 ?       Ssl  Jun01   0:17 /usr/sbin/clamd

Just over 100M on 64-bit.

@Stever:

@OverlordQ:

I doubt it actually uses 100 megs of ram

$ ps u -C clamd
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
clamav   24167  0.0 29.8 148700 105084 ?       Ssl  Jun01   0:17 /usr/sbin/clamd

Just over 100M on 64-bit.

a good client AV is much better for a "small" VPS like linode 360.

I was get the same problem using Debian Lenny (5.0) after Installing ISPConfig beta 3. It was because clamav and mysql memory usage. My swap was 100megs after I visit my wordpress site.

My solution was to remove clamav, fine tuning mysql and disabled innodb which I never use it. Now, I am not using any panel anymore, using 32bit instead 64bit and installing what I need.

              total       used       free     shared    buffers     cached
Mem:           360        191        168          0         12        141
-/+ buffers/cache:         37        323
Swap:          255          0        255

I am using Apache 2, PHP 5, Exim4 and MySQL.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct