From: Jim Jagielski Date: Mon, 15 Feb 2010 19:52:00 +0000 (+0000) Subject: *) worker: Don't report server has reached MaxClients until it has. X-Git-Tag: 2.2.15~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a44df7d5ad45df20f1f0856cedbb6b8f2204834;p=thirdparty%2Fapache%2Fhttpd.git *) worker: Don't report server has reached MaxClients until it has. Add message when server gets within MinSpareThreads of MaxClients. PR 46996. [Dan Poirier] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@910320 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 98b2c176010..e02ba7dece3 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,10 @@ Changes with Apache 2.2.15 access control is still vulnerable, unless using OpenSSL >= 0.9.8l. [Joe Orton, Ruediger Pluem, Hartmut Keil ] + *) 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_ssl: Reintroduce SSL_CLIENT_S_DN, SSL_CLIENT_I_DN, SSL_SERVER_S_DN, SSL_SERVER_I_DN back to the environment variables to be set by mod_ssl. [Peter Sylvester ] diff --git a/STATUS b/STATUS index 0311d44756f..9603f84995e 100644 --- a/STATUS +++ b/STATUS @@ -87,12 +87,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * worker: Don't log MaxClients until we actually hit it. Warn when within - MinSpareThreads of MaxClients. - Trunk patch: http://svn.apache.org/viewvc?rev=906535&view=rev - 2.2.x patch: http://people.apache.org/~poirier/maxclients-2.2.patch - +1: poirier, minfrin, jim - * mod_proxy: Allow https to a remote forward proxy by issuing an HTTP CONNECT request. This adds a CONNECT client (sending a connect request). It is not the same as mod_proxy_connect, which is a CONNECT server diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index b6b9447b70e..11c7d89cdee 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -1513,15 +1513,32 @@ static void perform_idle_server_maintenance(void) else if (idle_thread_count < min_spare_threads) { /* terminate the free list */ if (free_length == 0) { - /* 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"); - reported = 1; + /* No room for more children, might warn about configuration */ + if (active_thread_count >= ap_daemons_limit * ap_threads_per_child) { + /* no threads are "inactive" - starting, stopping, etc. - which would confuse matters */ + /* Are all threads in use? Then we're really at MaxClients */ + if (0 == idle_thread_count) { + /* 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"); + 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; + } + } } idle_spawn_rate = 1; }