From a17fd1388f1c1517a771239fa83a72bb32f5396f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Mon, 12 Jan 2004 16:22:35 +0000 Subject: [PATCH] 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 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102295 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/worker.html.en | 62 ++++++++++++++++++++++--------- docs/manual/mod/worker.xml | 68 ++++++++++++++++++++++++---------- 2 files changed, 93 insertions(+), 37 deletions(-) diff --git a/docs/manual/mod/worker.html.en b/docs/manual/mod/worker.html.en index dc1af0f352..faffd70b8a 100644 --- a/docs/manual/mod/worker.html.en +++ b/docs/manual/mod/worker.html.en @@ -79,15 +79,11 @@ uses
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 @@ uses 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 diff --git a/docs/manual/mod/worker.xml b/docs/manual/mod/worker.xml index 4a74086a10..d1e72a36b8 100644 --- a/docs/manual/mod/worker.xml +++ b/docs/manual/mod/worker.xml @@ -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 @@ uses 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 -- 2.50.1