Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun May 24, 2009 9:41 am 
Offline
Senior Member

Joined: Wed May 13, 2009 1:32 pm
Posts: 737
Location: Italy
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.


Top
   
 Post subject:
PostPosted: Sun May 24, 2009 10:47 am 
Offline
Senior Member

Joined: Thu May 21, 2009 3:19 am
Posts: 336
See:
http://www.linode.com/forums/viewtopic.php?t=4199

Which points to this:
http://chrisjohnston.org/2009/why-on-li ... -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.


Top
   
 Post subject:
PostPosted: Sun May 24, 2009 11:04 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
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 :-)


Top
   
 Post subject:
PostPosted: Sun May 24, 2009 11:13 am 
Offline
Senior Member

Joined: Thu May 21, 2009 3:19 am
Posts: 336
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.


Top
   
 Post subject:
PostPosted: Sun May 24, 2009 11:43 am 
Offline
Senior Member

Joined: Wed May 13, 2009 1:32 pm
Posts: 737
Location: Italy
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


Top
   
 Post subject:
PostPosted: Sun May 24, 2009 12:10 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
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.)


Top
   
 Post subject:
PostPosted: Sun May 24, 2009 12:37 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:32 pm
Posts: 737
Location: Italy
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-li ... -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.


Top
   
 Post subject:
PostPosted: Sun May 31, 2009 11:00 am 
Offline
Senior Member

Joined: Wed May 13, 2009 1:32 pm
Posts: 737
Location: Italy
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.


Top
   
 Post subject:
PostPosted: Wed Jun 03, 2009 4:21 pm 
Offline
Senior Member

Joined: Sat Jun 05, 2004 12:49 am
Posts: 333
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


Top
   
 Post subject:
PostPosted: Wed Jun 03, 2009 4:39 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:32 pm
Posts: 737
Location: Italy
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.


Top
   
 Post subject:
PostPosted: Thu Jun 04, 2009 11:11 am 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
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.


Top
   
 Post subject:
PostPosted: Thu Jun 04, 2009 5:03 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:32 pm
Posts: 737
Location: Italy
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.


Top
   
 Post subject:
PostPosted: Fri Jun 05, 2009 3:58 pm 
Offline
Newbie

Joined: Wed Apr 08, 2009 1:35 am
Posts: 4
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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: derfy and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group