| Author |
Message |
sblantipodi
Joined: 13 May 2009
Posts: 450
Location: Italy
|
| Posted: Sun May 24, 2009 8:41 am Post subject: 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. |
|
| Back to top |
|
waldo
Joined: 21 May 2009
Posts: 336
|
| Posted: Sun May 24, 2009 9:47 am Post subject: |
|
|
See:
http://www.linode.com/forums/viewtopic.php?t=4199
Which points to this:
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.
Code: 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. |
|
| Back to top |
|
hoopycat
Joined: 30 Aug 2008
Posts: 1286
Location: Rochester, New York
|
| Posted: Sun May 24, 2009 10:04 am Post subject: |
|
|
My system is using a little more memory, yet is still healthy (in my opinion):
Code:
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:
Code:
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 :-) |
|
| Back to top |
|
waldo
Joined: 21 May 2009
Posts: 336
|
| Posted: Sun May 24, 2009 10:13 am Post subject: |
|
|
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. |
|
| Back to top |
|
sblantipodi
Joined: 13 May 2009
Posts: 450
Location: Italy
|
| Posted: Sun May 24, 2009 10:43 am Post subject: |
|
|
ok, I divided my prefork value by two and now I have
quite double of ram.
Code: # 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?
Code: free -m
total used free shared buffers cached
Mem: 360 355 4 0 4 92
-/+ buffers/cache: 259 100
Swap: 255 0 255
|
|
| Back to top |
|
hoopycat
Joined: 30 Aug 2008
Posts: 1286
Location: Rochester, New York
|
| Posted: Sun May 24, 2009 11:10 am Post subject: |
|
|
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.) |
|
| Back to top |
|
sblantipodi
Joined: 13 May 2009
Posts: 450
Location: Italy
|
| Posted: Sun May 24, 2009 11:37 am Post subject: |
|
|
hoopycat wrote: 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-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. |
|
| Back to top |
|
sblantipodi
Joined: 13 May 2009
Posts: 450
Location: Italy
|
| Posted: Sun May 31, 2009 10:00 am Post subject: |
|
|
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. |
|
| Back to top |
|
OverlordQ
Joined: 04 Jun 2004
Posts: 312
|
| Posted: Wed Jun 03, 2009 3:21 pm Post subject: |
|
|
sblantipodi wrote: 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 |
|
| Back to top |
|
sblantipodi
Joined: 13 May 2009
Posts: 450
Location: Italy
|
| Posted: Wed Jun 03, 2009 3:39 pm Post subject: |
|
|
OverlordQ wrote: sblantipodi wrote: 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. |
|
| Back to top |
|
Stever
Joined: 07 Dec 2007
Posts: 337
Location: NC, USA
|
| Posted: Thu Jun 04, 2009 10:11 am Post subject: |
|
|
OverlordQ wrote: I doubt it actually uses 100 megs of ram
Code: $ 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. |
|
| Back to top |
|
sblantipodi
Joined: 13 May 2009
Posts: 450
Location: Italy
|
| Posted: Thu Jun 04, 2009 4:03 pm Post subject: |
|
|
Stever wrote: OverlordQ wrote: I doubt it actually uses 100 megs of ram
Code: $ 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. |
|
| Back to top |
|
dp
Joined: 08 Apr 2009
Posts: 4
|
| Posted: Fri Jun 05, 2009 2:58 pm Post subject: |
|
|
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.
Code:
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. |
|
| Back to top |
|
| |