Niall O Broin wrote:
> I just encountered an odd situation on a webserver where the load had
> become rather high, and top was showing me two apache processes each
> consuming > 45% of CPU. Running strace on one of the processes I saw
> that it was doing the below (and nothing else, or nothing else
> strace-able) in a loop:
> In all likelihood, this was caused by some piece of PHP gone mad but the
> question is, what, and how to find out? Given such a situation, is there
> any way of mapping a particular apache process to a request?
lsof -n|grep httpd|grep TCP|grep -v LISTEN
will tell you what IP address the apache process is connected to,
assuming it's still connected and handling it. Then you can hunt that
down in the request logs to find out the URL.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!