Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 48214 invoked from network); 12 Jan 2004 16:30:53 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 12 Jan 2004 16:30:53 -0000 Received: (qmail 57304 invoked by uid 500); 12 Jan 2004 16:30:17 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 57243 invoked by uid 500); 12 Jan 2004 16:30:16 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 57200 invoked by uid 500); 12 Jan 2004 16:30:16 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Received: (qmail 57183 invoked from network); 12 Jan 2004 16:30:16 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 12 Jan 2004 16:30:16 -0000 Received: (qmail 47756 invoked by uid 1121); 12 Jan 2004 16:30:21 -0000 Date: 12 Jan 2004 16:30:21 -0000 Message-ID: <20040112163021.47754.qmail@minotaur.apache.org> From: trawick@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/docs/manual/mod worker.xml worker.html.en X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N trawick 2004/01/12 08:30:21 Modified: docs/manual/mod Tag: APACHE_2_0_BRANCH worker.xml worker.html.en Log: update worker doc to mention that . a potentially large number of child processes can be in termination state . ServerLimit/ThreadLimit should be coded before other worker MPM directives which control processes/threads Revision Changes Path No revision No revision 1.8.2.5 +48 -20 httpd-2.0/docs/manual/mod/worker.xml Index: worker.xml =================================================================== RCS file: /home/cvs/httpd-2.0/docs/manual/mod/worker.xml,v retrieving revision 1.8.2.4 retrieving revision 1.8.2.5 diff -u -r1.8.2.4 -r1.8.2.5 --- worker.xml 23 Apr 2003 19:40:52 -0000 1.8.2.4 +++ worker.xml 12 Jan 2004 16:30:19 -0000 1.8.2.5 @@ -28,16 +28,12 @@ uses
How it Works -

Each process has a fixed - number of threads. The server adjusts to handle load by - increasing or decreasing the number of processes.

- -

A single control process is responsible for launching child - processes. Each child process creates a fixed number of threads as - specified in the ThreadsPerChild directive. The - individual threads then listen for connections and serve them when - they arrive.

+

A single control process (the parent) is responsible for launching + child processes. Each child process creates a fixed number of server + threads as specified in the ThreadsPerChild directive, as well + as a listener thread which listens for connections and passes them + to a server thread for processing when they arrive.

Apache always tries to maintain a pool of spare or idle server threads, which stand ready to serve incoming @@ -54,25 +50,57 @@ these directives from their default values. The maximum number of clients that may be served simultaneously (i.e., the maximum total number of threads in all processes) is determined by the - MaxClients directive, - while the maximum number of processes that can be launched is set - by the ServerLimit - directive. ServerLimit - multiplied by ThreadsPerChild must be greater - than or equal to MaxClients

+ MaxClients directive. + The maximum number of active child processes is determined by + the MaxClients + directive divided by the + ThreadsPerChild directive.

+ +

Two directives set hard limits on the number of active child + processes and the number of server threads in a child process, + and can only be changed by fully stopping the server and then + starting it again. ServerLimit + is a hard limit on the number of active child + processes, and must be greater than or equal to the + MaxClients + directive divided by the + ThreadsPerChild directive. + ThreadLimit is a hard + limit of the number of server threads, and must be greater than + or equal to the ThreadsPerChild directive. If + non-default values are specified for these directives, they + should appear before other worker directives.

+ +

In addition to a the set of active child processes, there may + be additional child processes which are terminating but where at + least one server thread is still handling an existing client + connection. Up to MaxClient terminating processes + may be present, though the actual number can be expected to be + much smaller. This behavior can be avoided by disabling the + termination of individual child processes, which is achieved by + the following:

+ +
    +
  • set the value of + MaxRequestsPerChild to zero
  • + +
  • set the value of + MaxSpareThreads to the same value as + MaxClients
  • +

A typical configuration of the process-thread controls in the worker MPM could look as follows:

+ ServerLimit 16
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
- ThreadsPerChild 25
- ServerLimit 16 + ThreadsPerChild 25

While the parent process is usually started as root 1.15.2.6 +45 -17 httpd-2.0/docs/manual/mod/worker.html.en Index: worker.html.en =================================================================== RCS file: /home/cvs/httpd-2.0/docs/manual/mod/worker.html.en,v retrieving revision 1.15.2.5 retrieving revision 1.15.2.6 diff -u -r1.15.2.5 -r1.15.2.6 --- worker.html.en 29 May 2003 19:29:53 -0000 1.15.2.5 +++ worker.html.en 12 Jan 2004 16:30:19 -0000 1.15.2.6 @@ -79,15 +79,11 @@

top

How it Works

-

Each process has a fixed - number of threads. The server adjusts to handle load by - increasing or decreasing the number of processes.

- -

A single control process is responsible for launching child - processes. Each child process creates a fixed number of threads as - specified in the ThreadsPerChild directive. The - individual threads then listen for connections and serve them when - they arrive.

+

A single control process (the parent) is responsible for launching + child processes. Each child process creates a fixed number of server + threads as specified in the ThreadsPerChild directive, as well + as a listener thread which listens for connections and passes them + to a server thread for processing when they arrive.

Apache always tries to maintain a pool of spare or idle server threads, which stand ready to serve incoming @@ -102,23 +98,55 @@ these directives from their default values. The maximum number of clients that may be served simultaneously (i.e., the maximum total number of threads in all processes) is determined by the - MaxClients directive, - while the maximum number of processes that can be launched is set - by the ServerLimit - directive. ServerLimit - multiplied by ThreadsPerChild must be greater - than or equal to MaxClients

+ MaxClients directive. + The maximum number of active child processes is determined by + the MaxClients + directive divided by the + ThreadsPerChild directive.

+ +

Two directives set hard limits on the number of active child + processes and the number of server threads in a child process, + and can only be changed by fully stopping the server and then + starting it again. ServerLimit + is a hard limit on the number of active child + processes, and must be greater than or equal to the + MaxClients + directive divided by the + ThreadsPerChild directive. + ThreadLimit is a hard + limit of the number of server threads, and must be greater than + or equal to the ThreadsPerChild directive. If + non-default values are specified for these directives, they + should appear before other worker directives.

+ +

In addition to a the set of active child processes, there may + be additional child processes which are terminating but where at + least one server thread is still handling an existing client + connection. Up to MaxClient terminating processes + may be present, though the actual number can be expected to be + much smaller. This behavior can be avoided by disabling the + termination of individual child processes, which is achieved by + the following:

+ +

A typical configuration of the process-thread controls in the worker MPM could look as follows:

+ ServerLimit 16
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
- ThreadsPerChild 25
- ServerLimit 16 + ThreadsPerChild 25

While the parent process is usually started as root