Forum Moderators: phranque

Message Too Old, No Replies

How to find which page/script is eating apache CPU

         

ehab

2:01 am on Nov 12, 2005 (gmt 0)



I have a linux dual CPU box with moderate traffic ( 2000 visitors per day ) running with multiple scripts. All my pages are dynamic.
Most of the time the apache processes are doing around 2% CPU utilization when seen in top. But once in a while I get an apache process to jump to around 30% cpu utilization.
I would like to know which page is generating this.
Is there a way to make apache log the CPU usage of each request in the access_log?
Is there another way to find out which page is causeing this.

serverrealty

6:34 pm on Nov 13, 2005 (gmt 0)

10+ Year Member



not sure if this will help, but consider something like
suexec for php, so that you see php running as the username who owns the files.

This helps me find sites that are taxing mysql.

You can also prolly find some information in apache server-status as to which domain is being used the most at the time you are having the problem.

Or, sometimes you can get some information out of the SHO PROCESSES list in phpMyAdmin.

That aside, 30% cpu is not out of hand, I see much higher usages from mysql across many many platforms.