From: Daniel Earl Poirier Date: Thu, 4 Feb 2010 16:00:51 +0000 (+0000) Subject: worker: don't report server has reached MaxClients until it does. X-Git-Tag: 2.3.6~514 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16b9ccd6ec7d767c6dce5270e28bdb319ac5d8e1;p=apache worker: don't report server has reached MaxClients until it does. 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 --- diff --git a/CHANGES b/CHANGES index 166bdc5fc3..542d2fc435 100644 --- 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] diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index 446572cfbf..d633ed1bde 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -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 {