HTTPD Memory Usage at 10 GB

3 posts / 0 new
Last post
#1 Fri, 10/23/2015 - 06:32
lostandfound

HTTPD Memory Usage at 10 GB

When I check the running processes linked from Virtualmin I see very high memory assigned to httpd/apache:

6010 mysql 2.90 GB /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/li ...
32238 apache 2.51 GB /usr/sbin/httpd -DFOREGROUND
32239 apache 2.51 GB /usr/sbin/httpd -DFOREGROUND
32241 apache 2.51 GB /usr/sbin/httpd -DFOREGROUND
30530 varnish 2.38 GB /usr/sbin/varnishd -P /var/run/varnish.pid -f /etc/varnish/oquile.vcl -a 94.136. ...
32553 apache 2.26 GB /usr/sbin/httpd -DFOREGROUND
923 memcached 1.37 GB /usr/bin/memcached -u memcached -p 11211 -m 1024 -c 1024 l27.0.0.1
570 root 699.75 MB /usr/sbin/rsyslogd -n
3071 named 690.57 MB /usr/sbin/named -u named
13139 root 688.11 MB /usr/sbin/httpd -DFOREGROUND
15062 root 574.61 MB php-fpm: master process (/etc/php-fpm.conf)
590 root 537.26 MB /usr/bin/python -Es /usr/sbin/tuned -l -P
17091 root 467.91 MB php-fpm: master process (/etc/opt/remi/php70/php-fpm.conf)
32237 apache 286.49 MB /usr/sbin/httpd -DFOREGROUND
32236 apache 285.34 MB /usr/sbin/httpd -DFOREGROUND

This seems incredibly high so I checked using the command: ps aux | awk '$11 ~ /httpd/ {c++; SUM +=$6; print $6/1024" MB, PID:", $2|"sort -rn| head"} END {print c" Total Apache Processes"} END {print SUM/1024" MB Total Memory"} END {print "Top 10 Memory users:"}'

7 Total Apache Processes
239.73 MB Total Memory
Top 10 Memory users:
58.418 MB, PID: 32241
51.2383 MB, PID: 32238
43.8125 MB, PID: 32553
31.1133 MB, PID: 32239
28.457 MB, PID: 13139
13.457 MB, PID: 32236
13.2344 MB, PID: 32237

As you can see, the PIDs are the same but memory usage is completely different.

Is this me misunderstanding what I am looking at or is it being miss-reported?

Fri, 10/23/2015 - 10:36
andreychek

Howdy,

Well, let's take a peek at this output here -- what is the output of this command:

ps auxw | grep apache

It's not that the first one in your post is wrong, but it also doesn't mean that Apache is using 10GB :-)

Processes can share memory with other processes, which can make it a bit tricky to determine exactly how much they're actually using.

-Eric

Fri, 10/23/2015 - 13:29
lostandfound

thanks Eric,

# ps auxw | grep apache
root     13452  0.0  0.0 112640   964 pts/0    S+   19:00   0:00 grep --color=auto apache
apache   32236  0.0  0.1 292192 13780 ?        S    08:59   0:00 /usr/sbin/httpd -DFOREGROUND
apache   32237  0.0  0.1 293368 13552 ?        S    08:59   0:00 /usr/sbin/httpd -DFOREGROUND
apache   32238  0.0  0.8 2632068 65856 ?       Sl   08:59   0:06 /usr/sbin/httpd -DFOREGROUND
apache   32239  0.0  0.8 2632068 65304 ?       Sl   08:59   0:06 /usr/sbin/httpd -DFOREGROUND
apache   32241  0.0  0.8 2632068 66428 ?       Sl   08:59   0:06 /usr/sbin/httpd -DFOREGROUND
apache   32553  0.0  0.8 2632068 67000 ?       Sl   09:00   0:06 /usr/sbin/httpd -DFOREGROUND

You said, Processes can share memory with other processes, which can make it a bit tricky to determine exactly how much they're actually using.. I think I understand what you mean. I suppose what I want to clarifying is what is free, as in, am I in danger of running out of memory.

Topic locked