Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I identify which URL is being processed by a certain HTTPD process?

I have the occasional HTTPD request on my web server that spikes CPU usage. I'm watching this in Top. Every URL is dynamically generated each time it's requested. The framework is Codeigniter. I'm using prefork Apache as my web server on Linux CentOS.

How can I figure out which URL is being processed when the CPU usage is spiking? Can I associate the Process ID with the HTTP request in the Apache logs somehow? There are millions of pages on the site, so looking at Codeignitor's profiler doesn't help.

like image 457
T. Brian Jones Avatar asked Jul 09 '12 17:07

T. Brian Jones


1 Answers

You could add the PID to your log (see http://httpd.apache.org/docs/current/mod/mod_log_config.html -- %P).

Or you could activate mod_status - that gives you a fairly useful live display with the most recent URL by that child.

like image 183
Dirk-Willem van Gulik Avatar answered Oct 14 '22 07:10

Dirk-Willem van Gulik