]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
MaxClients isn't the only reason the scoreboard can fill up. another
authorGreg Ames <gregames@apache.org>
Thu, 13 Apr 2006 17:53:04 +0000 (17:53 +0000)
committerGreg Ames <gregames@apache.org>
Thu, 13 Apr 2006 17:53:04 +0000 (17:53 +0000)
reason should be fixed soon.

also add a comment to explain an obscure line of code.

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

server/mpm/experimental/event/event.c
server/mpm/worker/worker.c

index 7f340300cc5bb407f86afe55eb1e5d5ed3a1c802..9bff9e30d9a6eb42e04c937ec0c2f08b6f13a0a5 100644 (file)
@@ -1705,6 +1705,10 @@ static void perform_idle_server_maintenance(void)
 
         if (i >= ap_max_daemons_limit
             && totally_free_length == idle_spawn_rate)
+            /* short cut if all active processes have been examined and
+             * enough empty scoreboard slots have been found
+             */
+        
             break;
         ps = &ap_scoreboard_image->parent[i];
         for (j = 0; j < ap_threads_per_child; j++) {
@@ -1795,15 +1799,23 @@ static void perform_idle_server_maintenance(void)
     }
     else if (idle_thread_count < min_spare_threads) {
         /* terminate the free list */
-        if (free_length == 0) {
+        if (free_length == 0) { /* scoreboard is full, can't fork */
             /* only report this condition once */
             static int reported = 0;
 
             if (!reported) {
-                ap_log_error(APLOG_MARK, APLOG_ERR, 0,
-                             ap_server_conf,
-                             "server reached MaxClients setting, consider"
-                             " raising the MaxClients setting");
+                if (active_thread_count >=
+                        ap_daemons_limit * ap_threads_per_child) {
+                    ap_log_error(APLOG_MARK, APLOG_ERR, 0,
+                                 ap_server_conf,
+                                 "server reached MaxClients setting, consider"
+                                 " raising the MaxClients setting");
+                }
+                else {
+                    ap_log_error(APLOG_MARK, APLOG_ERR, 0,
+                                 ap_server_conf,
+                                 "scoreboard is full, not at MaxClients");
+                }
                 reported = 1;
             }
             idle_spawn_rate = 1;
index faf9747e2e80fe39846942b6797cae27ab03e169..8d64860d95d3cfd4741ad24be5855fbef01622b2 100644 (file)
@@ -1397,6 +1397,9 @@ static void perform_idle_server_maintenance(void)
         int all_dead_threads = 1;
 
         if (i >= ap_max_daemons_limit && totally_free_length == idle_spawn_rate)
+            /* short cut if all active processes have been examined and
+             * enough empty scoreboard slots have been found
+             */
             break;
         ps = &ap_scoreboard_image->parent[i];
         for (j = 0; j < ap_threads_per_child; j++) {
@@ -1488,15 +1491,23 @@ static void perform_idle_server_maintenance(void)
     }
     else if (idle_thread_count < min_spare_threads) {
         /* terminate the free list */
-        if (free_length == 0) {
+        if (free_length == 0) { /* scoreboard is full, can't fork */
             /* only report this condition once */
             static int reported = 0;
 
             if (!reported) {
-                ap_log_error(APLOG_MARK, APLOG_ERR, 0,
-                             ap_server_conf,
-                             "server reached MaxClients setting, consider"
-                             " raising the MaxClients setting");
+                if (active_thread_count >= 
+                        ap_daemons_limit * ap_threads_per_child) { 
+                    ap_log_error(APLOG_MARK, APLOG_ERR, 0,
+                                 ap_server_conf,
+                                 "server reached MaxClients setting, consider"
+                                 " raising the MaxClients setting");
+                }    
+                else {
+                    ap_log_error(APLOG_MARK, APLOG_ERR, 0,
+                                 ap_server_conf,
+                                 "scoreboard is full, not at MaxClients");
+                }
                 reported = 1;
             }
             idle_spawn_rate = 1;