You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by ol...@veryhip.com on 2004/06/05 13:55:26 UTC

[users@httpd] match pid's to requests?

G'Morning,

I want an easy or possibly cryptic way to find out which PID is handling
which request.  I have found Apache::DebugInfo, but am looking for a more
direct approach; some file I can open and view or something similar.  I
have a memory leak in some CGI or PHP script and want to find out where it
is.  I have an apache instance as I speak that is 331MB and growing. 
Several at 100MB.  After a while, it swaps and gets worse.  It will run
fine for a long time after I shutdown and restart apache, but then it will
hit that bad script, start to grow, and at last: die.

I search the log after it shuts down, but it stops writing to the log
after it gets that bad, or so it seems.  It looks like it's a bot hitting
my pages and causing this effect because it's usually Yahoo's new Slurp
all over my logs right before death occurs to the server, but I still
can't locate the exact script because I think those requests that kill it
are happening a while back and then KeepAlive is just keeping it
connected, or something like that... If you've read this far you probably
know what I mean.  I have played around with KeepAlive settings, made my
timeout 10 and brought child requests down to 15 and other ridiculously
low figures for other config labels.  But this is a P4 2.4 800fsb 1 gb
DDR400 and a 160GB ata133, it should run the stock apache just fine. 
There is a bad script somewhere.  I have lots of rewrites, and it might be
a bad rewrite, but I can't pinpoint.

<HELP>
Apache 1.3.26
Debian 2.4.24-xfs custom kernel
Mid-grade hardware

Thanks,
Oliver Peek

---------------------------------------------------------------------
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] match pid's to requests?

Posted by Robert Andersson <ro...@profundis.nu>.
oliver@veryhip.com wrote:
> I want an easy or possibly cryptic way to find out which PID is
> handling which request.

You can log the PID using the %P directive with custom logs. See:
    http://httpd.apache.org/docs/mod/mod_log_config.html

> I search the log after it shuts down, but it stops writing to the log
> after it gets that bad, or so it seems.

You might be interested in mod_log_forensic, which I believe is design
specifically for such situations. See:
    http://httpd.apache.org/docs/mod/mod_log_forensic.html

Regards,
Robert Andersson


---------------------------------------------------------------------
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] match pid's to requests?

Posted by Aaron W Morris <aa...@mindspring.com>.
oliver@veryhip.com wrote:

> G'Morning,
> 
> I want an easy or possibly cryptic way to find out which PID is handling
> which request.  I have found Apache::DebugInfo, but am looking for a more
> direct approach; some file I can open and view or something similar.  I
> have a memory leak in some CGI or PHP script and want to find out where it
> is.  I have an apache instance as I speak that is 331MB and growing. 
> Several at 100MB.  After a while, it swaps and gets worse.  It will run
> fine for a long time after I shutdown and restart apache, but then it will
> hit that bad script, start to grow, and at last: die.
> 
> I search the log after it shuts down, but it stops writing to the log
> after it gets that bad, or so it seems.  It looks like it's a bot hitting
> my pages and causing this effect because it's usually Yahoo's new Slurp
> all over my logs right before death occurs to the server, but I still
> can't locate the exact script because I think those requests that kill it
> are happening a while back and then KeepAlive is just keeping it
> connected, or something like that... If you've read this far you probably
> know what I mean.  I have played around with KeepAlive settings, made my
> timeout 10 and brought child requests down to 15 and other ridiculously
> low figures for other config labels.  But this is a P4 2.4 800fsb 1 gb
> DDR400 and a 160GB ata133, it should run the stock apache just fine. 
> There is a bad script somewhere.  I have lots of rewrites, and it might be
> a bad rewrite, but I can't pinpoint.
> 
> <HELP>
> Apache 1.3.26
> Debian 2.4.24-xfs custom kernel
> Mid-grade hardware
> 
> Thanks,
> Oliver Peek
> 

Take a look at mod_status with the extended information enabled.


-- 
Aaron W Morris <aa...@mindspring.com> (decep)



---------------------------------------------------------------------
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