httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject process model again...
Date Wed, 08 Apr 1998 00:27:42 GMT
So I've been continuing with trying to figure out if the current
perform_idle_server_maintenance() code is right.  I'm now convinced that
we no longer need MinSpareServer, but can't give a good mathematical
reason for why.  It just doesn't seem necessary to keep many spare when
the server will exponentially spawn if a load presents itself.

Maybe others want to try the patch below so they can
watch their server spawn/kill children.

Ok so here's my log messages from today, with minspare=1, max=20.

[Tue Apr  7 00:51:55 1998] [info] server has 8 children, 0 are idle, spawning 1
[Tue Apr  7 03:10:50 1998] [info] server has 9 children, 0 are idle, spawning 1
[Tue Apr  7 03:10:51 1998] [info] server has 10 children, 0 are idle, spawning 1
[Tue Apr  7 03:10:52 1998] [info] server has 11 children, 0 are idle, spawning 1
[Tue Apr  7 03:10:53 1998] [info] server has 12 children, 0 are idle, spawning 1
[Tue Apr  7 03:10:54 1998] [info] server has 13 children, 0 are idle, spawning 1
[Tue Apr  7 06:29:17 1998] [info] server has 14 children, 0 are idle, spawning 1
[Tue Apr  7 08:59:25 1998] [info] server has 15 children, 0 are idle, spawning 1
[Tue Apr  7 09:40:44 1998] [info] server has 16 children, 0 are idle, spawning 1
[Tue Apr  7 09:40:45 1998] [info] server has 17 children, 0 are idle, spawning 1
[Tue Apr  7 09:40:47 1998] [info] server has 18 children, 0 are idle, spawning 1
[Tue Apr  7 15:10:56 1998] [info] server has 19 children, 0 are idle, spawning 1
[Tue Apr  7 15:10:58 1998] [info] server has 20 children, 0 are idle, spawning 1
[Tue Apr  7 15:10:59 1998] [info] server has 21 children, 0 are idle, spawning 2
[Tue Apr  7 15:11:22 1998] [info] server has 23 children, 21 are idle, killing one
[Tue Apr  7 15:11:33 1998] [info] server has 22 children, 22 are idle, killing one
[Tue Apr  7 15:11:34 1998] [info] server has 22 children, 22 are idle, killing one
[Tue Apr  7 15:11:35 1998] [info] server has 21 children, 21 are idle, killing one
[Tue Apr  7 15:11:36 1998] [info] server has 21 children, 21 are idle, killing one

A couple things.

Oh duh, there's a bug in the exponential spawning after a graceful.
That's why it doesn't exponential spawn at 03:10.

Notice the event around 15:11... this happens a lot, the server has 20+
children busy (sometimes 50+!) and then suddenly the load disappears
completely.  I *suspect* that it's some folks who have their concurent
sessions cranked really high.  I need to instrument more code to show
that though (need to give keepalive sessions unique tokens).

Here's some stuff from previous days, when min=4, max=20.

[Sun Apr  5 09:09:06 1998] [info] server has 20 children, 3 are idle, spawning 1
[Sun Apr  5 09:10:14 1998] [info] server has 21 children, 21 are idle, killing one
[Sun Apr  5 09:10:15 1998] [info] server has 21 children, 21 are idle, killing one
[Sun Apr  5 13:09:06 1998] [info] server has 20 children, 3 are idle, spawning 1
[Sun Apr  5 13:09:07 1998] [info] server has 21 children, 3 are idle, spawning 2
[Sun Apr  5 13:09:38 1998] [info] server has 23 children, 21 are idle, killing one
[Sun Apr  5 13:09:39 1998] [info] server has 23 children, 21 are idle, killing one
[Sun Apr  5 13:09:40 1998] [info] server has 22 children, 21 are idle, killing one
[Sun Apr  5 13:09:41 1998] [info] server has 22 children, 21 are idle, killing one
[Sun Apr  5 13:10:10 1998] [info] server has 21 children, 0 are idle, spawning 1
[Sun Apr  5 13:10:11 1998] [info] server has 22 children, 1 are idle, spawning 2
[Sun Apr  5 13:10:12 1998] [info] server has 24 children, 3 are idle, spawning 4
[Sun Apr  5 13:10:26 1998] [info] server has 28 children, 22 are idle, killing one
[Sun Apr  5 13:10:27 1998] [info] server has 28 children, 24 are idle, killing one
[Sun Apr  5 13:10:28 1998] [info] server has 27 children, 23 are idle, killing one
[Sun Apr  5 13:10:29 1998] [info] server has 27 children, 23 are idle, killing one
[Sun Apr  5 13:10:30 1998] [info] server has 26 children, 22 are idle, killing one
[Sun Apr  5 13:10:31 1998] [info] server has 25 children, 21 are idle, killing one
[Sun Apr  5 13:10:35 1998] [info] server has 24 children, 21 are idle, killing one
[Sun Apr  5 13:10:36 1998] [info] server has 24 children, 22 are idle, killing one
[Sun Apr  5 13:10:37 1998] [info] server has 23 children, 21 are idle, killing one
[Sun Apr  5 13:10:38 1998] [info] server has 23 children, 21 are idle, killing one
[Sun Apr  5 13:11:08 1998] [info] server has 22 children, 21 are idle, killing one
[Sun Apr  5 13:11:09 1998] [info] server has 22 children, 21 are idle, killing one
[Sun Apr  5 13:11:14 1998] [info] server has 21 children, 21 are idle, killing one
[Sun Apr  5 13:11:15 1998] [info] server has 21 children, 21 are idle, killing one
[Sun Apr  5 20:01:44 1998] [info] server has 20 children, 2 are idle, spawning 1
[Sun Apr  5 20:01:45 1998] [info] server has 21 children, 3 are idle, spawning 2
[Sun Apr  5 20:02:01 1998] [info] server has 23 children, 22 are idle, killing one
[Sun Apr  5 20:02:02 1998] [info] server has 23 children, 22 are idle, killing one
[Sun Apr  5 20:02:03 1998] [info] server has 22 children, 21 are idle, killing one
[Sun Apr  5 20:02:04 1998] [info] server has 22 children, 22 are idle, killing one
[Sun Apr  5 20:02:05 1998] [info] server has 21 children, 21 are idle, killing one
[Sun Apr  5 20:02:06 1998] [info] server has 21 children, 21 are idle, killing one
[Sun Apr  5 20:09:30 1998] [info] server has 20 children, 2 are idle, spawning 1
[Sun Apr  5 20:09:31 1998] [info] server has 21 children, 3 are idle, spawning 2
[Sun Apr  5 20:10:15 1998] [info] server has 23 children, 21 are idle, killing one
[Sun Apr  5 20:10:16 1998] [info] server has 23 children, 21 are idle, killing one
[Sun Apr  5 20:10:53 1998] [info] server has 22 children, 21 are idle, killing one
[Sun Apr  5 20:10:54 1998] [info] server has 22 children, 21 are idle, killing one
[Sun Apr  5 20:16:38 1998] [info] server has 21 children, 21 are idle, killing one
[Sun Apr  5 20:16:39 1998] [info] server has 21 children, 21 are idle, killing one
[Sun Apr  5 22:35:33 1998] [info] server has 20 children, 2 are idle, spawning 1
[Sun Apr  5 22:35:34 1998] [info] server has 21 children, 3 are idle, spawning 2
[Sun Apr  5 22:36:03 1998] [info] server has 23 children, 22 are idle, killing one
[Sun Apr  5 22:36:04 1998] [info] server has 23 children, 22 are idle, killing one
[Sun Apr  5 22:36:05 1998] [info] server has 22 children, 21 are idle, killing one
[Sun Apr  5 22:36:06 1998] [info] server has 22 children, 21 are idle, killing one
[Sun Apr  5 22:39:14 1998] [info] server has 21 children, 21 are idle, killing one
[Sun Apr  5 22:39:15 1998] [info] server has 21 children, 21 are idle, killing one
[Mon Apr  6 08:37:30 1998] [info] server has 20 children, 3 are idle, spawning 1
[Mon Apr  6 08:37:32 1998] [info] server has 21 children, 3 are idle, spawning 1
[Mon Apr  6 08:37:59 1998] [info] server has 22 children, 21 are idle, killing one
[Mon Apr  6 08:38:00 1998] [info] server has 22 children, 21 are idle, killing one
[Mon Apr  6 08:38:02 1998] [info] server has 21 children, 21 are idle, killing one
[Mon Apr  6 08:38:03 1998] [info] server has 21 children, 21 are idle, killing one
[Mon Apr  6 08:40:14 1998] [info] server has 20 children, 3 are idle, spawning 1
[Mon Apr  6 08:40:44 1998] [info] server has 21 children, 21 are idle, killing one
[Mon Apr  6 08:40:45 1998] [info] server has 21 children, 21 are idle, killing one
[Mon Apr  6 09:01:42 1998] [info] server has 20 children, 3 are idle, spawning 1
[Mon Apr  6 09:04:19 1998] [info] server has 21 children, 21 are idle, killing one
[Mon Apr  6 14:06:17 1998] [info] server has 20 children, 3 are idle, spawning 1
[Mon Apr  6 14:06:22 1998] [info] server has 21 children, 3 are idle, spawning 1
[Mon Apr  6 14:10:36 1998] [info] server has 22 children, 21 are idle, killing one
[Mon Apr  6 14:10:37 1998] [info] server has 22 children, 21 are idle, killing one
[Mon Apr  6 14:13:33 1998] [info] server has 21 children, 21 are idle, killing one
[Mon Apr  6 14:13:34 1998] [info] server has 21 children, 21 are idle, killing one

Notice how it's bouncing back and forth between spawning and then
killing immediately?

Here's a great sequence from earlier:

[Fri Apr  3 07:11:25 1998] [info] server has 20 children, 3 are idle, spawning 1
[Fri Apr  3 07:11:26 1998] [info] server has 21 children, 0 are idle, spawning 2
[Fri Apr  3 07:11:27 1998] [info] server has 23 children, 0 are idle, spawning 4
[Fri Apr  3 07:11:28 1998] [info] server has 27 children, 0 are idle, spawning 8
[Fri Apr  3 07:11:29 1998] [info] server has 35 children, 3 are idle, spawning 16
[Fri Apr  3 07:11:33 1998] [info] server has 51 children, 21 are idle, killing one
[Fri Apr  3 07:11:34 1998] [info] server has 51 children, 21 are idle, killing one
[Fri Apr  3 07:11:37 1998] [info] server has 50 children, 21 are idle, killing one
[Fri Apr  3 07:11:38 1998] [info] server has 50 children, 21 are idle, killing one
[Fri Apr  3 07:11:39 1998] [info] server has 49 children, 24 are idle, killing one
[Fri Apr  3 07:11:40 1998] [info] server has 49 children, 25 are idle, killing one
[Fri Apr  3 07:11:41 1998] [info] server has 48 children, 30 are idle, killing one
[Fri Apr  3 07:11:42 1998] [info] server has 48 children, 33 are idle, killing one
[Fri Apr  3 07:11:43 1998] [info] server has 47 children, 36 are idle, killing one
[Fri Apr  3 07:11:44 1998] [info] server has 47 children, 38 are idle, killing one
... and so on until it gets back down to 20 spare.

I dunno.  This is with the default keep-alive timeout of 15, most of
the site is static content, so there is a lot of keepalive going on.

It could just be that this box has really bursty traffic.

Dean

Index: main/http_main.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.316
diff -u -r1.316 http_main.c
--- http_main.c	1998/03/28 11:58:24	1.316
+++ http_main.c	1998/04/07 23:59:17
@@ -3658,6 +3676,9 @@
 	 * shut down gracefully, in case it happened to pick up a request
 	 * while we were counting
 	 */
+	aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf,
+	    "server has %d children, %d are idle, killing one",
+	    total_non_dead, idle_count);
 	kill(scoreboard_image->parent[to_kill].pid, SIGUSR1);
 	idle_spawn_rate = 1;
     }
@@ -3684,6 +3705,9 @@
 		    "%d total children", idle_spawn_rate,
 		    idle_count, total_non_dead);
 	    }
+	    aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf,
+		"server has %d children, %d are idle, spawning %d",
+		total_non_dead, idle_count, free_length);
 	    for (i = 0; i < free_length; ++i) {
 		make_child(server_conf, free_slots[i], now);
 	    }




Mime
View raw message