You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Gerald <gc...@inch.com> on 2004/12/14 19:09:13 UTC

[users@httpd] Apache Daemon; Which customer is memory hog?

Greetings,

Long time apache administrator, first time to post to the apache users
mailing list running apache+mod_ssl-1.3.33+2.8.22 on this problem
FreeBSD 4.8 machine. Short of tracing processes, is there anything
within apache to log which PIDs on a machine are serving which site
(%{PID})? Perhaps I could make a log format that includes how big the
apache process was when it terminated.

I've got a customer running a shared server with many sites on it and I
don't know which site is creating the huge apache processes. Is it the
PHP happy site that I already had to increase the php.ini memory_limit
for? Is it the online radio station hosting 30 MB MP3 files. ...or is it
the frequently abused forums on yet another site.

This machine probably has 30 sites and 3 prime candidates as the
memory hogs. ("large apache httpd memory processes" is too generic on
google/docs to get anything useful.)

top -ores first few lines:

  PID USERNAME        PRI NICE  SIZE    RES STATE    TIME   WCPU    CPU COMMAND
89166 www              18   0 29500K 22384K lockf    0:24  0.00%  0.00% httpd
90678 www              18   0 29732K 22132K lockf    0:28  0.00%  0.00% httpd
90684 www               2   0 29616K 22068K sbwait   0:21  0.00%  0.00% httpd
89167 www               2   0 29636K 21944K sbwait   0:24  0.24%  0.24% httpd

Mem: 317M Active, 34M Inact, 111M Wired, 14M Cache, 60M Buf, 15M Free
Swap: 2048M Total, 176M Used, 1872M Free, 8% Inuse

None of the apache processes are below 10 MB at the moment and the majority
are > 25 MB.

Thanks in advance for any suggestions/input.

Gerald

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache Daemon; Which customer is memory hog?

Posted by Gerald <gc...@inch.com>.
On Tue, 14 Dec 2004, Joshua Slive wrote:

> Yes, you can add the PID to the log files.  See:
> http://httpd.apache.org/docs/mod/mod_log_config.html

I did read that page before posting to the list. That is what I used
to formulate the context of my guess from my E-mail "(%{PID})?"
I have not, unfortunately, been successful in finding the actual
environment variable name that contains the PID. Do you know of a
specific environment variable that contains the PID(s)? Seeing as
any modification to the logging will throw off the web log analyser
(acceptable for a short amount of time to derive the memory hog), I
would not like to go plugging guesses in to my apache config. I have not
yet found a complete list of environment variables or even a list that
contains the variable I am looking for.

> You can also use mod_status to find current PIDs and URLs and match
> that to your top output.

Thank you for the suggestion. I'll go read up on mod_status now.

Gerald

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache Daemon; Which customer is memory hog?

Posted by Joshua Slive <js...@gmail.com>.
On Tue, 14 Dec 2004 13:09:13 -0500 (EST), Gerald <gc...@inch.com> wrote:
> Greetings,
> 
> Long time apache administrator, first time to post to the apache users
> mailing list running apache+mod_ssl-1.3.33+2.8.22 on this problem
> FreeBSD 4.8 machine. Short of tracing processes, is there anything
> within apache to log which PIDs on a machine are serving which site
> (%{PID})? Perhaps I could make a log format that includes how big the
> apache process was when it terminated.

Yes, you can add the PID to the log files.  See:
http://httpd.apache.org/docs/mod/mod_log_config.html

You can also use mod_status to find current PIDs and URLs and match
that to your top output.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org