httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1361778 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/event.xml server/mpm/event/event.c
Date Sun, 15 Jul 2012 19:52:06 GMT
Author: sf
Date: Sun Jul 15 19:52:06 2012
New Revision: 1361778

URL: http://svn.apache.org/viewvc?rev=1361778&view=rev
Log:
Don't count connections in lingering close state when
calculating how many additional connections may be accepted

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/event.xml
    httpd/httpd/trunk/server/mpm/event/event.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1361778&r1=1361777&r2=1361778&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sun Jul 15 19:52:06 2012
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mpm_event: Don't count connections in lingering close state when
+     calculating how many additional connections may be accepted.
+     [Stefan Fritsch]
+
   *) mod_deflate: Skip compression if compression is enabled at SSL level.
      [Stefan Fritsch]
 

Modified: httpd/httpd/trunk/docs/manual/mod/event.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/event.xml?rev=1361778&r1=1361777&r2=1361778&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/event.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/event.xml Sun Jul 15 19:52:06 2012
@@ -166,7 +166,8 @@ of consuming threads only for connection
 
     <p>This directive can be used to fine-tune the per-process connection
     limit. A process will only accept new connections if the current number of
-    connections is lower than:</p>
+    connections (not counting connections in the "closing" state) is lower
+    than:</p>
 
     <p class="indent"><strong>
         <directive module="mpm_common">ThreadsPerChild</directive> +

Modified: httpd/httpd/trunk/server/mpm/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1361778&r1=1361777&r2=1361778&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/event/event.c Sun Jul 15 19:52:06 2012
@@ -1632,9 +1632,11 @@ static void * APR_THREAD_FUNC listener_t
                                  "All workers busy, not accepting new conns"
                                  "in this process");
                 }
-                else if (apr_atomic_read32(&connection_count) > threads_per_child
-                         + ap_queue_info_get_idlers(worker_queue_info) *
-                           worker_factor / WORKER_FACTOR_SCALE)
+                else if (  (int)apr_atomic_read32(&connection_count)
+                           - (int)apr_atomic_read32(&lingering_count)
+                         > threads_per_child
+                           + ap_queue_info_get_idlers(worker_queue_info) *
+                             worker_factor / WORKER_FACTOR_SCALE)
                 {
                     if (!listeners_disabled)
                         disable_listensocks(process_slot);
@@ -1769,10 +1771,11 @@ static void * APR_THREAD_FUNC listener_t
             ps->suspended = apr_atomic_read32(&suspended_count);
             ps->lingering_close = apr_atomic_read32(&lingering_count);
         }
-        if (listeners_disabled && !workers_were_busy &&
-            (int)apr_atomic_read32(&connection_count) <
-            ((int)ap_queue_info_get_idlers(worker_queue_info) - 1) *
-            worker_factor / WORKER_FACTOR_SCALE + threads_per_child)
+        if (listeners_disabled && !workers_were_busy
+            && (int)apr_atomic_read32(&connection_count)
+               - (int)apr_atomic_read32(&lingering_count)
+               < ((int)ap_queue_info_get_idlers(worker_queue_info) - 1)
+                 * worker_factor / WORKER_FACTOR_SCALE + threads_per_child)
         {
             listeners_disabled = 0;
             enable_listensocks(process_slot);



Mime
View raw message