]> granicus.if.org Git - apache/blobdiff - docs/manual/mod/prefork.xml
Merge in APR[-util] macros from branches/trunk-buildconf-noapr
[apache] / docs / manual / mod / prefork.xml
index c5288611dd852a72e3291eb93a99672bfd2ab6df..715b581a2ccdda64e3b8ab9d5bd95620538a7217 100644 (file)
 
 <summary>
     <p>This Multi-Processing Module (MPM) implements a non-threaded,
-    pre-forking web server that handles requests in a manner similar
-    to Apache 1.3.  It is appropriate for sites that need to avoid
+    pre-forking web server. Each server process may answer incoming
+    requests, and a parent process manages the size of the server pool.
+    It is appropriate for sites that need to avoid
     threading for compatibility with non-thread-safe libraries.  It
     is also the best MPM for isolating each request, so that a problem
     with a single request will not affect any other.</p>
 
     <p>This MPM is very self-regulating, so it is rarely necessary to
     adjust its configuration directives.  Most important is that
-    <directive module="mpm_common">MaxClients</directive> be big enough to 
-    handle as many simultaneous requests as you expect to receive, but
+    <directive module="mpm_common">MaxRequestWorkers</directive> be big enough
+    to handle as many simultaneous requests as you expect to receive, but
     small enough to assure that there is enough physical RAM for all
     processes.</p>
 </summary>
-<seealso><a href="../bind.html">Setting which addresses and ports Apache
+<seealso><a href="../bind.html">Setting which addresses and ports Apache HTTP Server
 uses</a></seealso>
 
 <section id="how-it-works"><title>How it Works</title>
     <p>A single control process is responsible for launching child
     processes which listen for connections and serve them when they
-    arrive. Apache always tries to maintain several <dfn>spare</dfn>
+    arrive. Apache httpd always tries to maintain several <dfn>spare</dfn>
     or idle server processes, which stand ready to serve incoming
     requests. In this way, clients do not need to wait for a new
     child processes to be forked before their requests can be
@@ -58,14 +59,14 @@ uses</a></seealso>
     <p>The <directive module="mpm_common">StartServers</directive>,
     <directive module="prefork">MinSpareServers</directive>,
     <directive module="prefork">MaxSpareServers</directive>, and
-    <directive module="mpm_common">MaxClients</directive> regulate how
+    <directive module="mpm_common">MaxRequestWorkers</directive> regulate how
     the parent process creates children to serve requests. In general,
-    Apache is very self-regulating, so most sites do not need to
+    Apache httpd is very self-regulating, so most sites do not need to
     adjust these directives from their default values. Sites which
     need to serve more than 256 simultaneous requests may need to
-    increase <directive module="mpm_common">MaxClients</directive>,
+    increase <directive module="mpm_common">MaxRequestWorkers</directive>,
     while sites with limited memory may need to decrease <directive
-    module="mpm_common">MaxClients</directive> to keep the server from
+    module="mpm_common">MaxRequestWorkers</directive> to keep the server from
     thrashing (swapping memory to disk and back). More information
     about tuning process creation is provided in the <a
     href="../misc/perf-tuning.html">performance hints</a>
@@ -73,16 +74,24 @@ uses</a></seealso>
 
     <p>While the parent process is usually started as <code>root</code>
     under Unix in order to bind to port 80, the child processes are
-    launched by Apache as a less-privileged user. The <directive
+    launched by Apache httpd as a less-privileged user. The <directive
     module="mod_unixd">User</directive> and <directive
     module="mod_unixd">Group</directive> directives are used to set
-    the privileges of the Apache child processes. The child processes
+    the privileges of the Apache httpd child processes. The child processes
     must be able to read all the content that will be served, but
     should have as few privileges beyond that as possible.</p>
 
-    <p><directive module="mpm_common">MaxRequestsPerChild</directive>
+    <p><directive module="mpm_common">MaxConnectionsPerChild</directive>
     controls how frequently the server recycles processes by killing
     old ones and launching new ones.</p>
+
+    <p>This MPM uses the <code>mpm-accept</code> mutex to serialize
+    access to incoming connections when subject to the thundering herd
+    problem (generally, when there are multiple listening sockets).
+    The implementation aspects of this mutex can be configured with the
+    <directive module="core">Mutex</directive> directive.  The <a
+    href="../misc/perf-tuning.html">performance hints</a>
+    documentation has additional information about this mutex.</p>
 </section>
 
 <directivesynopsis location="mpm_common"><name>CoreDumpDirectory</name>
@@ -95,13 +104,11 @@ uses</a></seealso>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>ListenBacklog</name>
 </directivesynopsis>
-<directivesynopsis location="mpm_common"><name>LockFile</name>
-</directivesynopsis>
-<directivesynopsis location="mpm_common"><name>MaxClients</name>
+<directivesynopsis location="mpm_common"><name>MaxRequestWorkers</name>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>MaxMemFree</name>
 </directivesynopsis>
-<directivesynopsis location="mpm_common"><name>MaxRequestsPerChild</name>
+<directivesynopsis location="mpm_common"><name>MaxConnectionsPerChild</name>
 </directivesynopsis>
 <directivesynopsis location="mpm_common"><name>ScoreBoardFile</name>
 </directivesynopsis>
@@ -117,8 +124,6 @@ uses</a></seealso>
 </directivesynopsis>
 <directivesynopsis location="mod_unixd"><name>Group</name>
 </directivesynopsis>
-<directivesynopsis location="mpm_common"><name>AcceptMutex</name>
-</directivesynopsis>
 
 <directivesynopsis>
 <name>MaxSpareServers</name>
@@ -137,12 +142,13 @@ uses</a></seealso>
     <p>Tuning of this parameter should only be necessary on very
     busy sites. Setting this parameter to a large number is almost
     always a bad idea. If you are trying to set the value equal to or lower than
-    <directive module="prefork">MinSpareServers</directive>, Apache
+    <directive module="prefork">MinSpareServers</directive>, Apache HTTP Server
     will automatically adjust it to <directive
     >MinSpareServers</directive><code> + 1</code>.</p>
 </usage>
 <seealso><directive module="prefork">MinSpareServers</directive></seealso>
 <seealso><directive module="mpm_common">StartServers</directive></seealso>
+<seealso><directive module="mpm_common">MaxSpareThreads</directive></seealso>
 </directivesynopsis>
 
 <directivesynopsis>
@@ -157,7 +163,11 @@ uses</a></seealso>
     desired minimum number of <em>idle</em> child server processes. An
     idle process is one which is not handling a request. If there are
     fewer than <directive>MinSpareServers</directive> idle, then the parent
-    process creates new children at a maximum rate of 1 per second.</p>
+    process creates new children: It will spawn one, wait a second, then spawn
+    two, wait a second, then spawn four, and it will
+    continue exponentially until it is spawning 32 children per second. It will
+    stop whenever it satisfies the <directive>MinSpareServers</directive>
+    setting.</p>
 
     <p>Tuning of this parameter should only be necessary on very
     busy sites. Setting this parameter to a large number is almost
@@ -165,6 +175,7 @@ uses</a></seealso>
 </usage>
 <seealso><directive module="prefork">MaxSpareServers</directive></seealso>
 <seealso><directive module="mpm_common">StartServers</directive></seealso>
+<seealso><directive module="mpm_common">MinSpareThreads</directive></seealso>
 </directivesynopsis>
 
 </modulesynopsis>