]> granicus.if.org Git - apache/commitdiff
The accept loop was sleeping way too long when we ran out of completion contexts.
authorBill Stoddard <stoddard@apache.org>
Wed, 10 Apr 2002 17:02:00 +0000 (17:02 +0000)
committerBill Stoddard <stoddard@apache.org>
Wed, 10 Apr 2002 17:02:00 +0000 (17:02 +0000)
All that is really necessary is that the accept look yield the rest of its time slice
when this condition is hit.

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

CHANGES
server/mpm/winnt/mpm_winnt.c

diff --git a/CHANGES b/CHANGES
index d2dd8e385d8473a33010ac93c575baa45874ef34..f3ca2bd7d2fe52aa4763ce82059bd6022b4aa8b9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,7 @@
 Changes with Apache 2.0.36
+  *) Win32: Fix problem that caused rapid performance degradation
+     when number of connecting clients exceeded ThreadsPerChild.
+     [Bill Stoddard]
 
   *) Fixed a segfault parsing large SSIs on non-mmap systems.
      [Brian Havard]
index 08d0c9dd684a1373f37a8d6d441ef6904c9a7b08..2b965d9ab1c0c007067df51832e87b0f35b33a33 100644 (file)
@@ -921,8 +921,9 @@ static void winnt_accept(void *listen_socket)
         if (!context) {
             /* Hopefully whatever is preventing us from getting a 
              * completion context is a temporary resource constraint.
+             * Yield the rest of our time slice.
              */
-            Sleep(750);
+            Sleep(0);
             continue;
         }
 
@@ -931,11 +932,11 @@ static void winnt_accept(void *listen_socket)
         if (context->accept_socket == INVALID_SOCKET) {
             context->accept_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
             if (context->accept_socket == INVALID_SOCKET) {
-                /* Hopefully another temporary condition. Be graceful. */
+                /* Another temporary condition? */
                 ap_log_error(APLOG_MARK,APLOG_WARNING, apr_get_netos_error(), ap_server_conf,
                              "winnt_accept: Failed to allocate an accept socket. "
                              "Temporary resource constraint? Try again.");
-                Sleep(500);
+                Sleep(100);
                 goto again;
             }
         }
@@ -971,7 +972,7 @@ static void winnt_accept(void *listen_socket)
                              "winnt_accept: AcceptEx failed. Attempting to recover.");
                 closesocket(context->accept_socket);
                 context->accept_socket = INVALID_SOCKET;
-                Sleep(500);
+                Sleep(100);
                 goto again;
             }