Forum Moderators: phranque

Message Too Old, No Replies

how to log the CPU usage of each request

         

alluoshi

6:58 pm on Jan 29, 2009 (gmt 0)

10+ Year Member



Hello, Apache logs each request and some information about this request, however I want to log the process ID and the cpu usage of each request. I found it possible to log the process ID by changing the default log format. Is there any way that I can log the cpu usage for each process. I can see the cpu usage in the server-status page but I want this information in the log file.

alluoshi

3:55 pm on Jan 31, 2009 (gmt 0)

10+ Year Member



After a deep research, there is no simple solution to log the cpu time of each request. We probably should write our own model. Since Apache logs the time taken to serve each request, so what is the difference between this time and the cpu time of the process?
Is it true to say that the time taken to serve the request = cpu time of the request + other time like I/O time taken by the server + swapping time?