httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tianwei <>
Subject signal handler questions
Date Tue, 08 Dec 2009 07:12:52 GMT
Hi, all,
   I am doing a PMU(performance monitor unit) profiling work on apache now.
As the first step, I need to find a way to enable and disable the profiling.
I configure the apache as --with-mpm=worker, by my default configuration, it
will start 3 child processes(27threads for each process, 25 worker threads,
1 listen threads, 1 main server threads). Now I put my start function at the
entry of "child_main" in mpm/worker/worker.c.  Then during serving the
request, my code will do a self-monitoring style according to the PMU
samples. However, I do not know where to put my stop function code. The
following is my current way:
  1. I may use "sudo ./bin/apachctl -k stop" to stop the httpd
  2. normally the "stop" will be caught by the parent process, then it will
continue to sent "KILL" to child processes
  3. then for each child process, it will catch the signal from parent
process and continue to kill all its threads.
I want to put  my "stop" function at the start of step 3 where each child
process receive the signals from parent process.

I search the documents and debug the code a lot, but still can not
understand the signal-handler mechanism in httpd. Can anyone kindly point me
to the right document or code place where I can insert my stop function?

Thanks very much.


Sheng, Tianwei
Inst. of High Performance Computing
Dept. of Computer Sci. & Tech.
Tsinghua Univ.

View raw message