httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Behlendorf <br...@hyperreal.com>
Subject Taming the server if it cannot fork (fwd)
Date Tue, 17 Sep 1996 04:41:50 GMT


---------- Forwarded message ----------
Date: Mon, 16 Sep 1996 09:40:32 +0200
From: Andreas Koenig <k@anna.in-berlin.de>
Reply-To: andreas.koenig@franz.ww.tu-berlin.de
To: new-httpd@hyperreal.com
Subject: Taming the server if it cannot fork

I recently watched the 1.1.1 server in a situation where it could not
fork all of its children (for reasons you do not want to know). I
discovered that make_child fails too quickly in such a case so the
loop around the make_child() call consumes the whole CPU. I'd suggest
that make_child sleeps for a second if it fails to fork. That way you
reduce system load in a situation that is most probably already
unpleasant.

Here's my proposal:

--- http_main.c-1.63  Mon Sep 16 09:27:34 1996
+++ http_main.c Mon Sep 16 09:27:43 1996
@@ -1549,6 +1549,7 @@
 
     if ((pid = fork()) == -1) {
        log_unixerr("fork", NULL, "Unable to fork new process", server_conf);
+       sleep 1;
        return;
     } 
     


Regards,
andreas




Mime
View raw message