httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject Re: [PATCH] Possible fix for worker MPM performance problem
Date Thu, 25 Apr 2002 16:11:52 GMT
Ooops, try this one instead... The listener would not start in the previous patch. Thanks
to Paul Reder for catching this.

Bill

Index: worker.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
retrieving revision 1.117
diff -u -r1.117 worker.c
--- worker.c 18 Apr 2002 17:46:20 -0000 1.117
+++ worker.c 25 Apr 2002 16:06:18 -0000
@@ -999,16 +999,15 @@
                 clean_child_exit(APEXIT_CHILDFATAL);
             }
             threads_created++;
-            if (threads_created == 1) {
-                /* now that we have a worker thread, it makes sense to create
-                 * a listener thread (we don't want a listener without a worker!)
-                 */
-                create_listener_thread(ts);
-            }
+
         }
+        /* All the workers have started. Now start the listener thread */
+        create_listener_thread(ts);
+
         if (start_thread_may_exit || threads_created == ap_threads_per_child) {
             break;
         }
+
         /* wait for previous generation to clean up an entry */
         apr_sleep(1 * APR_USEC_PER_SEC);
         ++loops;

----- Original Message -----
From: "Bill Stoddard" <bill@wstoddard.com>
To: <dev@httpd.apache.org>
Sent: Thursday, April 25, 2002 11:30 AM
Subject: [PATCH] Possible fix for worker MPM performance problem


> Would someone care to see if this fixes the worker MPM performance problem reported
> earlier on the list (request-per-second dropping when clients exceeded threadsperchild)?
> This patch defers starting the listener untill -all- the workers have started.
>
> Bill
>
> Index: worker.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
> retrieving revision 1.117
> diff -u -r1.117 worker.c
> --- worker.c 18 Apr 2002 17:46:20 -0000 1.117
> +++ worker.c 25 Apr 2002 15:24:51 -0000
> @@ -999,16 +999,15 @@
>                  clean_child_exit(APEXIT_CHILDFATAL);
>              }
>              threads_created++;
> -            if (threads_created == 1) {
> -                /* now that we have a worker thread, it makes sense to create
> -                 * a listener thread (we don't want a listener without a worker!)
> -                 */
> -                create_listener_thread(ts);
> -            }
> +
>          }
>          if (start_thread_may_exit || threads_created == ap_threads_per_child) {
>              break;
>          }
> +
> +        /* All the workers have started. Now start the listener thread */
> +        create_listener_thread(ts);
> +
>          /* wait for previous generation to clean up an entry */
>          apr_sleep(1 * APR_USEC_PER_SEC);
>          ++loops;
>
>


Mime
View raw message