Current time: 11-25-2024, 08:45 AM Hello There, Guest! (LoginRegister)


Post Reply 
php5-cgi huge memory usage
Author Message
vanshyr Offline
Junior Member
*

Posts: 33
Joined: Apr 2009
Reputation: 0
Post: #4
RE: php5-cgi huge memory usage
In shell prompt type the comand (as root): ps aux

It output a list of proceses used by all users, all programs and how much memory they are using.
maybe other process and not php/apache is using the big part of ram.

If i do it returns this:

Code:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
clamav    3139  0.0  1.7 183848 143896 ?       Ssl  Jun29  32:49 /usr/sbin/clamd
root      8608  0.0  0.1  12912  8792 ?        S    Sep01   0:00 /usr/bin/perl /var/www/ispcp/engine/ispcp-apache-logger -e
root      8611  0.0  0.1  13184  9048 ?        S    Sep01   0:01 /usr/bin/perl /var/www/ispcp/engine/ispcp-apache-logger
www-data  8612  0.0  0.0  18404  5204 ?        S    Sep01   0:00 /usr/sbin/apache2 -k start
www-data  8613  0.0  0.0  18724  5328 ?        S    Sep01   0:00 /usr/sbin/apache2 -k start
www-data  8616  0.0  0.1 245092 12108 ?        Sl   Sep01   0:11 /usr/sbin/apache2 -k start
www-data  8644  0.0  0.1 244992 11968 ?        Sl   Sep01   0:10 /usr/sbin/apache2 -k start
vu2027    8698  0.0  0.0  20068  5664 ?        Ss   Sep01   0:00 /usr/bin/php5-cgi
vu2027    8699  0.0  0.0  20360  4752 ?        S    Sep01   0:01 /usr/bin/php5-cgi
vu2027    8700  0.0  0.0  20360  4756 ?        S    Sep01   0:01 /usr/bin/php5-cgi
vu2035    8758  0.0  0.0  20068  5660 ?        Ss   Sep01   0:00 /usr/bin/php5-cgi
vu2035    8759  0.0  0.1  27924 10620 ?        S    Sep01   0:27 /usr/bin/php5-cgi
vu2035    8760  0.0  0.1  28744 11208 ?        S    Sep01   0:28 /usr/bin/php5-cgi
vu2013    8765  0.0  0.0  20068  5664 ?        Ss   Sep01   0:00 /usr/bin/php5-cgi
vu2013    8766  0.0  0.0  21324  6316 ?        S    Sep01   0:06 /usr/bin/php5-cgi
vu2013    8767  0.0  0.0  21340  6408 ?        S    Sep01   0:05 /usr/bin/php5-cgi
vu2016    8801  0.0  0.0  20068  5664 ?        Ss   Sep01   0:00 /usr/bin/php5-cgi
vu2016    8802  0.0  0.0  20508  4604 ?        S    Sep01   0:00 /usr/bin/php5-cgi
vu2016    8803  0.0  0.0  20508  4604 ?        S    Sep01   0:00 /usr/bin/php5-cgi
vu2017    9134  0.0  0.0  20068  5664 ?        Ss   Sep01   0:00 /usr/bin/php5-cgi
vu2017    9135  0.0  0.0  24832  7476 ?        S    Sep01   0:03 /usr/bin/php5-cgi
vu2017    9136  0.0  0.1  27872 10500 ?        S    Sep01   0:04 /usr/bin/php5-cgi
backuppc  9149  0.0  0.0  13496  7864 ?        S    Aug11   0:14 /usr/bin/perl /usr/share/backuppc/bin/BackupPC -d
backuppc  9155  0.0  0.0   9692  4792 ?        S    Aug11   0:01 /usr/bin/perl /usr/share/backuppc/bin/BackupPC_trashClean
vu2015    9340  0.0  0.0  20068  5660 ?        Ss   Sep01   0:00 /usr/bin/php5-cgi
vu2015    9341  0.0  0.0  20068  3604 ?        S    Sep01   0:00 /usr/bin/php5-cgi
vu2015    9342  0.0  0.0  20068  3764 ?        S    Sep01   0:00 /usr/bin/php5-cgi
vu2033    9462  0.0  0.0  20068  5664 ?        Ss   Sep01   0:00 /usr/bin/php5-cgi
vu2033    9463  0.0  0.1  29404 12052 ?        S    Sep01   0:12 /usr/bin/php5-cgi
vu2033    9464  0.0  0.1  28388 11072 ?        S    Sep01   0:14 /usr/bin/php5-cgi
root     12563  0.0  0.0  12848  6164 ?        Ss   Aug31   0:00 /usr/bin/perl -T /usr/bin/iwatch -f /etc/iwatch/iwatch.xml -p /var/run/iwatch.pid -d
root     17577  0.0  0.0   4036  1204 ?        S    Aug21   0:00 /usr/bin/couriertls -server -tcpd /usr/lib/courier/courier/imaplogin /usr/bin/imapd Maildir

look i have many process too, but they consume 0.01 of Mem and 0 CPU, except the first one (1,7 Mem), an antivirus system, maybe in that moment it was analizing some file.

anf if i take a look at my memory usage right now:
Code:
free -m
             total       used       free     shared    buffers     cached
Mem:          8114       7858        255          0        202       6807
-/+ buffers/cache:        848       7266
Swap:         2859          0       2859

It seems that i have only 255 Mem free, but look at line 'buffers/cache' it have 7266Mb cached (can be replaced by differents process but is 'free' for be occuped by who needs).

Using swap memory 'nots good' it means that you lack Ram and need to 'virtualize' it in HDD.

So try the above command and try to find what process its really using the ram.
(You should to evaluate too, how many users you have?, maybe the RAM is well used but you need to put more ram on the server).

Smile
(08-30-2010 11:15 PM)bleed Wrote:  I'm just beginner at linux. I used webmin to get that list.

Don't know if it's also normal, but RAM is full and also 2GB of swap is beeing used.
09-03-2010 01:21 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
php5-cgi huge memory usage - bleed - 08-30-2010, 06:26 AM
RE: php5-cgi huge memory usage - joximu - 08-30-2010, 08:12 PM
RE: php5-cgi huge memory usage - bleed - 08-30-2010, 11:15 PM
RE: php5-cgi huge memory usage - vanshyr - 09-03-2010 01:21 AM
RE: php5-cgi huge memory usage - Kwik - 10-27-2010, 05:15 PM
RE: php5-cgi huge memory usage - pgentoo - 10-30-2010, 06:56 AM
RE: php5-cgi huge memory usage - Kwik - 10-30-2010, 08:09 AM
RE: php5-cgi huge memory usage - kilburn - 10-30-2010, 05:27 PM
RE: php5-cgi huge memory usage - kassah - 10-31-2010, 01:28 AM
RE: php5-cgi huge memory usage - kilburn - 11-02-2010, 06:02 AM

Forum Jump:


User(s) browsing this thread: 5 Guest(s)