httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@uolsinectis.com.ar
Subject new module: cpu-times
Date Tue, 09 Mar 2004 15:43:04 GMT


Hi,

I wrote a module for apache 1.3 (I called it mod_cpu), which measures cpu time consumed on
each request, and logs to error_log user, system and user+system times if any of them is greater
than configured value.

If a request involved forking and executing an external program, mod_cpu does not account
child cpu usage.  mod_cpu calls getrusage in two hooks:
1) post read_request
2) log
then, substrating the cpu usage values, I get cpu usage per request.

httpd calls to wait4 after request is logged, and I guess this is why (I guess) mod_cpu does
not account child cpu usage: cpu times of childs are accounted once parent process called
any of wait* (right?).

How may I solve this?
Should/must I call wait4 in mod_cpu?

Thank you very much in advance,

-- 
Gonzalo Arana
Ingenieria
UOLSinectis

Florida 537 Piso 6, Buenos Aires, Argentina 
+54-11-4321-9110 ext 2543
http://www.uolsinectis.com.ar/


Mime
View raw message