]> granicus.if.org Git - apache/commitdiff
Fix the forking/killing logic in the threaded MPM. The problem we were
authorRyan Bloom <rbb@apache.org>
Tue, 3 Jul 2001 13:58:10 +0000 (13:58 +0000)
committerRyan Bloom <rbb@apache.org>
Tue, 3 Jul 2001 13:58:10 +0000 (13:58 +0000)
seeing with the server eating itself wasn't because we were comparing
the idle_thread_count and min/max spare servers wrong.  It was because
we were counting idle_thread_count incorrectly.  This fixes that problem.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89495 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/threaded/threaded.c

index 2331df0ca9a8951c06942eecadb25ba6c12506db..f601c0d6cdb66d4470995db4d796911defe9e7c3 100644 (file)
@@ -1003,15 +1003,15 @@ static void perform_idle_server_maintenance(void)
     }
     ap_max_daemons_limit = last_non_dead + 1;
 
-    if (idle_thread_count > max_spare_threads * total_non_dead) {
-        /* Kill off one child */
+    if (idle_thread_count > max_spare_threads) {
         char char_of_death = '!';
+        /* Kill off one child */
         if ((rv = apr_file_write(pipe_of_death_out, &char_of_death, &one)) != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, "write pipe_of_death");
         }
         idle_spawn_rate = 1;
     }
-    else if (idle_thread_count < min_spare_threads * total_non_dead) {
+    else if (idle_thread_count < min_spare_threads) {
         /* terminate the free list */
         if (free_length == 0) {
            /* only report this condition once */