]> granicus.if.org Git - apache/commitdiff
worker: don't report server has reached MaxClients until it does.
authorDaniel Earl Poirier <poirier@apache.org>
Thu, 4 Feb 2010 16:00:51 +0000 (16:00 +0000)
committerDaniel Earl Poirier <poirier@apache.org>
Thu, 4 Feb 2010 16:00:51 +0000 (16:00 +0000)
Add warning when within MinSpareThreads.

PR: 46996

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

CHANGES
server/mpm/worker/worker.c

diff --git a/CHANGES b/CHANGES
index 166bdc5fc3190bcd34e2088596efcf558bbf849a..542d2fc435df421bf9bf8a41cb4b4f281f5418c8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 
 Changes with Apache 2.3.6
 
+  *) worker: Don't report server has reached MaxClients until it has.
+     Add message when server gets within MinSpareThreads of MaxClients.
+     PR 46996.  [Dan Poirier]
+
   *) mod_session: Session expiry was being initialised, but not updated
      on each session save, resulting in timed out sessions when there
      should not have been. Fixed. [Graham Leggett]
index 446572cfbff4cd7dd7f5e5119f44e51e6a4020dc..d633ed1bdeaa97ee417b058bfe32f5e2b3b768ee 100644 (file)
@@ -1547,14 +1547,27 @@ static void perform_idle_server_maintenance(void)
         if (free_length == 0) { /* scoreboard is full, can't fork */
 
             if (active_thread_count >= ap_daemons_limit * threads_per_child) { 
-                static int reported = 0;
-                if (!reported) {
-                    /* only report this condition once */
-                    ap_log_error(APLOG_MARK, APLOG_ERR, 0,
-                                 ap_server_conf,
-                                 "server reached MaxClients setting, consider"
-                                 " raising the MaxClients setting");
-                    reported = 1;
+                /* no threads are "inactive" - starting, stopping, etc. */
+                /* have we reached MaxClients, or just getting close? */
+                if (0 == idle_thread_count) {
+                    static int reported = 0;
+                    if (!reported) {
+                        /* only report this condition once */
+                        ap_log_error(APLOG_MARK, APLOG_ERR, 0,
+                                     ap_server_conf,
+                                     "server reached MaxClients setting, consider"
+                                     " raising the MaxClients setting");
+                        reported = 1;
+                    }
+                } else {
+                    static int reported = 0;
+                    if (!reported) {
+                        ap_log_error(APLOG_MARK, APLOG_ERR, 0,
+                                     ap_server_conf,
+                                     "server is within MinSpareThreads of MaxClients, "
+                                     "consider raising the MaxClients setting");
+                        reported = 1;
+                    }
                 }
             }
             else {