It seems that before a process has initialized fully we'll give
another process the same slot.
Here is a trace I added to the end of make_child():
Index: server/mpm/threaded/threaded.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/threaded/threaded.c,v
retrieving revision 1.50
diff -u -r1.50 threaded.c
--- server/mpm/threaded/threaded.c 2001/07/26 18:11:53 1.50
+++ server/mpm/threaded/threaded.c 2001/07/27 01:13:06
@@ -899,6 +899,11 @@
clean_child_exit(0);
}
+ap_log_error(APLOG_MARK, APLOG_CRIT, 0, ap_server_conf,
+ "just created process %d for slot %d (old value %d)",
+ pid, slot,
+ ap_scoreboard_image->parent[slot].pid);
+
/* else */
ap_scoreboard_image->parent[slot].pid = pid;
return 0;
Here is an example of what is traced:
startup - three processes are created
[Thu Jul 26 21:02:02 2001] [crit] just created process 5471 for slot 0 (old value 0)
[Thu Jul 26 21:02:02 2001] [crit] just created process 5472 for slot 1 (old value 0)
[Thu Jul 26 21:02:02 2001] [crit] just created process 5473 for slot 2 (old value 0)
[Thu Jul 26 21:02:02 2001] [notice] Apache/2.0.22-dev (Unix) DAV/2 configured --
resuming normal operations
[Thu Jul 26 21:02:02 2001] [info] Server built: Jul 26 2001 20:24:29
started pounding the server, trying to create more processes
t0 - create one process
no problem yet
[Thu Jul 26 21:02:05 2001] [crit] just created process 5556 for slot 3 (old value 0)
t1 - create two processes
note that we screw up slot 3 'cause it is in use by process 5556,
which probably hasn't had time to fully initialize so I guess one of
the worker scores had the wrong status value
[Thu Jul 26 21:02:06 2001] [crit] just created process 5565 for slot 3 (old value 5556)
[Thu Jul 26 21:02:06 2001] [crit] just created process 5566 for slot 4 (old value 0)
t2 - create one process
again we steal the slot for a process which we kicked off in the
previous idle_server_maintenance window
[Thu Jul 26 21:02:07 2001] [crit] just created process 5594 for slot 3 (old value 5565)
[Thu Jul 26 21:02:08 2001] [crit] just created process 5595 for slot 4 (old value 5566)
[Thu Jul 26 21:02:08 2001] [crit] just created process 5602 for slot 5 (old value 0)
[Thu Jul 26 21:02:08 2001] [crit] just created process 5603 for slot 6 (old value 0)
[Thu Jul 26 21:02:09 2001] [info] server seems busy, (you may need to increase
StartServers, ThreadsPerChild or Min/MaxSpareThreads), spawning 4 children, there are
around 8 idle threads, and 8 total children
I don't think we should be taking over an in-use slot unless
1) in use by a previous generation process gracefully dying due to
apachectl restart
or
2) in use by a current generation process gracefully dying due to
reaching MaxRequestsPerChild
Currently, we're taking over slots just because the process hasn't had
a chance to initialize.
I can sorta see Ryan's design for allowing a process in a new
generation to use a slot still in use by the previous generation, but
---/---
I'm getting a segfault with threaded.c on this particular Linux box I
haven't solved yet. I had hoped that the one I found/fixed earlier
today would take care of this problem, but no such luck.
no coredump, no clues
--
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...