mpm_common.html.en revision ab7fab7c5b562b3886904f616a825c2231302995
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<html xmlns="http://www.w3.org/TR/xhtml1/strict"><head><!--
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
a7835c7a8cf86045fdaee65dc2839bfe6314fb1end This file is generated from xml source: DO NOT EDIT
db878466c5e95073429dda0bdd001f45e9486e16fielding XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
db878466c5e95073429dda0bdd001f45e9486e16fielding --><title>mpm_common- Apache HTTP Server</title><link href="/style/manual.css" type="text/css" rel="stylesheet"/></head><body><blockquote><div align="center"><img src="/images/sub.gif" alt="[APACHE DOCUMENTATION]"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mpm_common</h1><table cellspacing="1" cellpadding="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap" valign="top"><span class="help">Description:</span></td><td>A collection of directives that are implemented by
db878466c5e95073429dda0bdd001f45e9486e16fieldingmore than one multi-processing module (MPM)</td></tr><tr><td nowrap="nowrap"><a href="module-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr></table></td></tr></table><h2>Directives</h2><ul><li><a href="#coredumpdirectory">CoreDumpDirectory</a></li><li><a href="#group">Group</a></li><li><a href="#listen">Listen</a></li><li><a href="#listenbacklog">ListenBackLog</a></li><li><a href="#lockfile">LockFile</a></li><li><a href="#maxclients">MaxClients</a></li><li><a href="#maxrequestsperchild">MaxRequestsPerChild</a></li><li><a href="#maxsparethreads">MaxSpareThreads</a></li><li><a href="#maxthreadsperchild">MaxThreadsPerChild</a></li><li><a href="#minsparethreads">MinSpareThreads</a></li><li><a href="#numservers">NumServers</a></li><li><a href="#pidfile">PidFile</a></li><li><a href="#scoreboardfile">ScoreBoardFile</a></li><li><a href="#sendbuffersize">SendBufferSize</a></li><li><a href="#serverlimit">ServerLimit</a></li><li><a href="#startservers">StartServers</a></li><li><a href="#startthreads">StartThreads</a></li><li><a href="#threadlimit">ThreadLimit</a></li><li><a href="#threadsperchild">ThreadsPerChild</a></li><li><a href="#user">User</a></li></ul><hr/><h2><a name="CoreDumpDirectory">CoreDumpDirectory</a> <a name="coredumpdirectory">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Directory where Apache attempts to
db878466c5e95073429dda0bdd001f45e9486e16fieldingswitch before dumping core</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>CoreDumpDirectory <em>directory</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>See usage for the default setting</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="perchild.html">perchild</a></code>, <code><a href="prefork.html">prefork</a></code>, <code><a href="mpm_winnt.html">mpm_winnt</a></code></td></tr></table></td></tr></table>
db878466c5e95073429dda0bdd001f45e9486e16fielding
db878466c5e95073429dda0bdd001f45e9486e16fielding <p>This controls the directory to which Apache attempts to
a7835c7a8cf86045fdaee65dc2839bfe6314fb1end switch before dumping core. The default is in the
a7835c7a8cf86045fdaee65dc2839bfe6314fb1end <a href="core.html#serverroot" class="directive"><code class="directive">ServerRoot</code></a> directory, however
a7835c7a8cf86045fdaee65dc2839bfe6314fb1end since this should not be writable by the user the server runs
a7835c7a8cf86045fdaee65dc2839bfe6314fb1end as, core dumps won't normally get written. If you want a core
a7835c7a8cf86045fdaee65dc2839bfe6314fb1end dump for debugging, you can use this directive to place it in a
a7835c7a8cf86045fdaee65dc2839bfe6314fb1end different location.</p>
a7835c7a8cf86045fdaee65dc2839bfe6314fb1end<hr/><h2><a name="Group">Group</a> <a name="group">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Group under which the server will answer
a7835c7a8cf86045fdaee65dc2839bfe6314fb1endrequests</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>Group <em>unix-group</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>Group #-1</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config, virtual host</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="perchild.html">perchild</a></code>, <code><a href="prefork.html">prefork</a></code></td></tr></table></td></tr></table>
a7835c7a8cf86045fdaee65dc2839bfe6314fb1end <p>The <code class="directive">Group</code> directive sets the group under
a7835c7a8cf86045fdaee65dc2839bfe6314fb1end which the server will answer requests. In order to use this
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive directive, the stand-alone server must be run initially as root.
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <em>Unix-group</em> is one of:</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <dl>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <dt>A group name</dt>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <dd>Refers to the given group by name.</dd>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <dt># followed by a group number.</dt>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <dd>Refers to a group by its number.</dd>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive </dl>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>It is recommended that you set up a new group specifically for
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive running the server. Some admins use user <code>nobody</code>,
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive but this is not always possible or desirable.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>Note: if you start the server as a non-root user, it will
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive fail to change to the specified group, and will instead
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive continue to run as the group of the original user.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>Special note: Use of this directive in &lt;VirtualHost&gt; is
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive no longer supported. To implement the <a href="/suexec.html">suEXEC wrapper</a> with Apache 2.0, use the
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <a href="mod_suexec.html#suexecusergroup" class="directive"><code class="directive">SuexecUserGroup</code></a>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive directive. SECURITY: See <a href="#user" class="directive"><code class="directive">User</code></a> for a discussion of the
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive security considerations.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<hr/><h2><a name="Listen">Listen</a> <a name="listen">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>IP addresses and ports that the server
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslivelistens to</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>Listen [<em>IP-address</em>:]<em>portnumber</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="perchild.html">perchild</a></code>, <code><a href="prefork.html">prefork</a></code>, <code><a href="mpm_winnt.html">mpm_winnt</a></code></td></tr></table></td></tr></table>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>The <code class="directive">Listen</code> directive instructs Apache to
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive listen to only specific IP addresses or ports; by default it
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive responds to requests on all IP interfaces. The Listen directive is
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive now a required directive. If it is not in the config file, the
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive server will fail to start. This is a change from previous versions
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive of Apache.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>The Listen directive tells the server to accept incoming
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive requests on the specified port or address-and-port combination.
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive If only a port number is specified, the server listens to the
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive given port on all interfaces. If an IP address is given as well
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive as a port, the server will listen on the given port and
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive interface.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>Multiple Listen directives may be used to specify a number
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive of addresses and ports to listen to. The server will respond to
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive requests from any of the listed addresses and ports.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>For example, to make the server accept connections on both
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive port 80 and port 8000, use:</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive Listen 80<br>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive Listen 8000
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</code></td></tr></table></blockquote>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>To make the server accept connections on two specified
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive interfaces and port numbers, use </p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive Listen 192.170.2.1:80<br>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive Listen 192.170.2.5:8000
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive</code></td></tr></table></blockquote>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>IPv6 addresses must be surrounded in square brackets, as in the
1cb160a981947e75a8353da3fe40a653aa87100eslive following example:</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
46d1ef8cb385aa2f519ce7d355afc51f144bd938slive Listen [fe80::a00:20ff:fea7:ccea]:80
8794d6ba53e0d88bb9d6bee4d7e79c1a8b265444nd</code></td></tr></table></blockquote>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<p><strong>See also </strong></p><ul><li><a href="/dns-caveats.html">DNS Issues</a></li><li><a href="/bind.html">Setting
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive which addresses and ports Apache uses</a></li></ul><hr/><h2><a name="ListenBackLog">ListenBackLog</a> <a name="listenbacklog">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Maximum length of the queue of pending connections</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>ListenBacklog <em>backlog</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>ListenBacklog 511</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="perchild.html">perchild</a></code>, <code><a href="prefork.html">prefork</a></code>, <code><a href="mpm_winnt.html">mpm_winnt</a></code></td></tr></table></td></tr></table>
1cb160a981947e75a8353da3fe40a653aa87100eslive <p>The maximum length of the queue of pending connections.
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive Generally no tuning is needed or desired, however on some
1cb160a981947e75a8353da3fe40a653aa87100eslive systems it is desirable to increase this when under a TCP SYN
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive flood attack. See the backlog parameter to the
8794d6ba53e0d88bb9d6bee4d7e79c1a8b265444nd <code>listen(2)</code> system call.</p>
46d1ef8cb385aa2f519ce7d355afc51f144bd938slive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>This will often be limited to a smaller number by the
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive operating system. This varies from OS to OS. Also note that
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive many OSes do not use exactly what is specified as the backlog,
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive but use a number based on (but normally larger than) what is
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive set.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<hr/><h2><a name="LockFile">LockFile</a> <a name="lockfile">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Location of the accept serialization lock file</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>LockFile <em>filename</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>LockFile logs/accept.lock</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="perchild.html">perchild</a></code>, <code><a href="prefork.html">prefork</a></code></td></tr></table></td></tr></table>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>The <code class="directive">LockFile</code> directive sets the path to
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive the lockfile used when Apache is compiled with either
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive USE_FCNTL_SERIALIZED_ACCEPT or USE_FLOCK_SERIALIZED_ACCEPT. This
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive directive should normally be left at its default value. The main
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive reason for changing it is if the <code>logs</code> directory is
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive NFS mounted, since <strong>the lockfile must be stored on a local
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive disk</strong>. The PID of the main server process is
5e9423b4ca454c6416a2dc465dea1b1d34cec7a9slive automatically appended to the filename.</p>
5e9423b4ca454c6416a2dc465dea1b1d34cec7a9slive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p><strong>SECURITY:</strong> It is best to avoid putting this
58842e03db54033d15cc224d997f467abc88a97aslive file in a world writable directory such as
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <code>/var/tmp</code> because someone could create a denial of
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive service attack and prevent the server from starting by creating
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive a lockfile with the same name as the one the server will try to
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive create.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<hr/><h2><a name="MaxClients">MaxClients</a> <a name="maxclients">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Maximum number of child processes that will be created
3fa58e00171aebf3b2cfa90035ed530f5b1f651dsliveto serve requests</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>MaxClients <em>number</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>MaxClients
46d1ef8cb385aa2f519ce7d355afc51f144bd938slive 8 (with threads) MaxClients 256</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="prefork.html">prefork</a></code></td></tr></table></td></tr></table>
1c6a10274e908898347be82bc82bc7ae18c66410slive <p>The <code class="directive">MaxClients</code> directive sets the limit
1c6a10274e908898347be82bc82bc7ae18c66410slive on the number of child processes that will be created to serve
1c6a10274e908898347be82bc82bc7ae18c66410slive requests. When the server is built without threading, no more than
1c6a10274e908898347be82bc82bc7ae18c66410slive this number of clients can be served simultaneously. To configure
1c6a10274e908898347be82bc82bc7ae18c66410slive more than 256 clients with the prefork MPM, you must use the
1c6a10274e908898347be82bc82bc7ae18c66410slive <a href="#serverlimit" class="directive"><code class="directive">ServerLimit</code></a> directive.
1c6a10274e908898347be82bc82bc7ae18c66410slive To configure more than 1024 clients with the worker MPM, you must
1c6a10274e908898347be82bc82bc7ae18c66410slive use the <a href="#serverlimit" class="directive"><code class="directive">ServerLimit</code></a> and
1c6a10274e908898347be82bc82bc7ae18c66410slive <a href="#threadlimit" class="directive"><code class="directive">ThreadLimit</code></a> directives.</p>
1c6a10274e908898347be82bc82bc7ae18c66410slive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>Any connection attempts over the
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <code class="directive">MaxClients</code> limit will normally be queued,
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive up to a number based on the <a href="#listenbacklog" class="directive"><code class="directive">ListenBacklog</code></a> directive. Once a child
46d1ef8cb385aa2f519ce7d355afc51f144bd938slive process is freed at the end of a different request, the connection
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive will then be serviced.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>When the server is compiled with threading, then the maximum
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive number of simultaneous requests that can be served is obtained
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive from the value of this directive multiplied by
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <a href="#threadsperchild" class="directive"><code class="directive">ThreadsPerChild</code></a>.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<hr/><h2><a name="MaxRequestsPerChild">MaxRequestsPerChild</a> <a name="maxrequestsperchild">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Limit on the number of requests that an individual child server
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslivewill handle during its life</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>MaxRequestsPerChild <em>number</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>MaxRequestsPerChild 10000</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="perchild.html">perchild</a></code>, <code><a href="prefork.html">prefork</a></code>, <code><a href="mpm_winnt.html">mpm_winnt</a></code></td></tr></table></td></tr></table>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>The <code class="directive">MaxRequestsPerChild</code> directive sets
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive the limit on the number of requests that an individual child
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive server process will handle. After
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <code class="directive">MaxRequestsPerChild</code> requests, the child
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive process will die. If <code class="directive">MaxRequestsPerChild</code> is
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive 0, then the process will never expire.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>Setting <code class="directive">MaxRequestsPerChild</code> to a
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive non-zero limit has two beneficial effects:</p>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd
b7be634703e0147134ba63da0657c59802fee6efnd <ul>
b7be634703e0147134ba63da0657c59802fee6efnd <li>it limits the amount of memory that process can consume
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd by (accidental) memory leakage;</li>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <li>by giving processes a finite lifetime, it helps reduce
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd the number of processes when the server load reduces.</li>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd </ul>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <p><strong>NOTE:</strong> For <em>KeepAlive</em> requests, only
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd the first request is counted towards this limit. In effect, it
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd changes the behavior to limit the number of
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <em>connections</em> per child.</p>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd<hr/><h2><a name="MaxSpareThreads">MaxSpareThreads</a> <a name="maxsparethreads">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Maximum number of idle threads</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>MaxSpareThreads <em>number</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="mpm_netware.html">mpm_netware</a></code>, <code><a href="perchild.html">perchild</a></code>, <code><a href="worker.html">worker</a></code></td></tr></table></td></tr></table>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <p>Maximum number of idle threads. Different MPMs deal with this
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd directive differently.</p>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <p>For <code><a href="perchild.html">perchild</a></code> the default is
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <code>MaxSpareThreads 10</code>. This MPM monitors the number of
b7be634703e0147134ba63da0657c59802fee6efnd idle threads on a per-child basis. If there are too many idle
b7be634703e0147134ba63da0657c59802fee6efnd threads in that child, the server will begin to kill threads
b7be634703e0147134ba63da0657c59802fee6efnd within that child.</p>
1c6a10274e908898347be82bc82bc7ae18c66410slive
1c6a10274e908898347be82bc82bc7ae18c66410slive <p>For <code><a href="worker.html">worker</a></code> the default is
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <code>MaxSpareThreads 500</code>. This MPM deals with idle threads
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive on a server-wide basis. If there are too many idle threads in the
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive server then child processes are killed until the number of idle
97d4d9527b64d7491543a12a3d21134b857cbe4bnd threads is less than this number.</p>
97d4d9527b64d7491543a12a3d21134b857cbe4bnd
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>For <code><a href="mpm_netware.html">mpm_netware</a></code> the default is
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <code>MaxSpareThreads 100</code>. Since this MPM runs a
b7be634703e0147134ba63da0657c59802fee6efnd single-process, the spare thread count is also server-wide.</p>
b7be634703e0147134ba63da0657c59802fee6efnd
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd<p><strong>See also </strong></p><ul><li><a href="#minsparethreads" class="directive"><code class="directive">MinSpareThreads</code></a></li><li><a href="#startservers" class="directive"><code class="directive">StartServers</code></a></li></ul><hr/><h2><a name="MaxThreadsPerChild">MaxThreadsPerChild</a> <a name="maxthreadsperchild">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Maximum number of threads per child process</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>MaxThreadsPerChild <em>number</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>MaxThreadsPerChild 64</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="perchild.html">perchild</a></code></td></tr></table></td></tr></table>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <p>Maximum number of threads per child. For MPMs with a
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd variable number of threads per child, this directive sets the
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd maximum number of threads that will be created in each child
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd process. To increase this value beyond its default, it is
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd necessary to change the value of the compile-time define
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <code>HARD_THREAD_LIMIT</code> and recompile the server.</p>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd<hr/><h2><a name="MinSpareThreads">MinSpareThreads</a> <a name="minsparethreads">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Minimum number of idle threads available to handle request
1b1089891b9656b0298b116bf4b95fb0d5f74c59ndspikes</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>MinSpareServers <em>number</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="mpm_netware.html">mpm_netware</a></code>, <code><a href="perchild.html">perchild</a></code>, <code><a href="worker.html">worker</a></code></td></tr></table></td></tr></table>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <p>Minimum number of idle threads to handle request spikes.
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd Different MPMs deal with this directive
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd differently.</p>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <p><code><a href="perchild.html">perchild</a></code> uses a default of
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <code>MinSpareThreads 5</code> and monitors the number of idle
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd threads on a per-child basis. If there aren't enough idle threads
b7be634703e0147134ba63da0657c59802fee6efnd in that child, the server will begin to create new threads within
b7be634703e0147134ba63da0657c59802fee6efnd that child.</p>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd
1c6a10274e908898347be82bc82bc7ae18c66410slive <p><code><a href="worker.html">worker</a></code> uses a default of <code>MinSpareThreads
1c6a10274e908898347be82bc82bc7ae18c66410slive 250</code> and deals with idle threads on a server-wide basis. If
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd there aren't enough idle threads in the server then child
97d4d9527b64d7491543a12a3d21134b857cbe4bnd processes are created until the number of idle threads is greater
97d4d9527b64d7491543a12a3d21134b857cbe4bnd than number.</p>
97d4d9527b64d7491543a12a3d21134b857cbe4bnd
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p><code><a href="mpm_netware.html">mpm_netware</a></code> uses a default of
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <code>MinSpareThreads 10</code> and, since it is a single-process
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive MPM, tracks this on a server-wide bases.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<p><strong>See also </strong></p><ul><li><a href="#maxsparethreads" class="directive"><code class="directive">MaxSpareThreads</code></a></li><li><a href="#startservers" class="directive"><code class="directive">StartServers</code></a></li></ul><hr/><h2><a name="NumServers">NumServers</a> <a name="numservers">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Total number of children alive at the same time</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>NumServers <em>number</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>NumServers 2</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="perchild.html">perchild</a></code></td></tr></table></td></tr></table>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>Number of children alive at the same time. MPMs that use
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive this directive do not dynamically create new child processes so
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd this number should be large enough to handle the requests for
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd the entire site.</p>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd<hr/><h2><a name="PidFile">PidFile</a> <a name="pidfile">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>File where the server records the process ID
3fa58e00171aebf3b2cfa90035ed530f5b1f651dsliveof the daemon</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>PidFile <em>filename</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>PidFile logs/httpd.pid</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="perchilde.html">perchilde</a></code>, <code><a href="prefork.html">prefork</a></code>, <code><a href="mpm_winnt.html">mpm_winnt</a></code></td></tr></table></td></tr></table>
01979b991e320f79fe2c1ae2afc298e8651bd69aslive <p>The <code class="directive">PidFile</code> directive sets the file to
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd which the server records the process id of the daemon. If the
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd filename does not begin with a slash (/) then it is assumed to be
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd relative to the <a href="core.html#serverroot" class="directive"><code class="directive">ServerRoot</code></a>.</p>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><p align="center"><strong>Example</strong></p><code>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd PidFile /var/run/apache.pid
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd </code></td></tr></table></blockquote>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd
1c6a10274e908898347be82bc82bc7ae18c66410slive <p>It is often useful to be able to send the server a signal,
1c6a10274e908898347be82bc82bc7ae18c66410slive so that it closes and then reopens its <a href="core.html#errorlog" class="directive"><code class="directive">ErrorLog</code></a> and TransferLog, and
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive re-reads its configuration files. This is done by sending a
97d4d9527b64d7491543a12a3d21134b857cbe4bnd SIGHUP (kill -1) signal to the process id listed in the
97d4d9527b64d7491543a12a3d21134b857cbe4bnd PidFile.</p>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <p>The PidFile is subject to the same warnings about log file
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd placement and <a href="/misc/security_tips.html#serverroot">security</a>.</p>
97d4d9527b64d7491543a12a3d21134b857cbe4bnd<hr/><h2><a name="ScoreBoardFile">ScoreBoardFile</a> <a name="scoreboardfile">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Location of the file used to store coordination data for
97d4d9527b64d7491543a12a3d21134b857cbe4bndthe child processes</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>ScoreBoardFile <em>file-path</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>ScoreBoardFile logs/apache_status</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="perchild.html">perchild</a></code>, <code><a href="prefork.html">prefork</a></code></td></tr></table></td></tr></table>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd <p>Apache uses a scoreboard to communicate between its parent
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd and child processes. Some architectures require a file to facilitate
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd this communication. If the file is left unspecified, Apache first
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd attempts to create the scoreboard entirely in memory (using anonymous
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd shared memory) and, failing that, will attempt to create the file on
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd disk (using file-based shared memory). Specifying this directive causes
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd Apache to always create the file on the disk.</p>
1b1089891b9656b0298b116bf4b95fb0d5f74c59nd
1c6a10274e908898347be82bc82bc7ae18c66410slive <blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><p align="center"><strong>Example</strong></p><code>
1c6a10274e908898347be82bc82bc7ae18c66410slive ScoreBoardFile /var/run/apache_status
97d4d9527b64d7491543a12a3d21134b857cbe4bnd </code></td></tr></table></blockquote>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>File-based shared memory is useful for third-party applications
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive that require direct access to the scoreboard.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>If you use a <code class="directive">ScoreBoardFile</code> then
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive you may see improved speed by placing it on a RAM disk. But be
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive careful that you heed the same warnings about log file placement
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive and <a href="/misc/security_tips.html">security</a>.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<p><strong>See also </strong></p><ul><li><a href="/stopping.html">Stopping and Restarting Apache</a></li></ul><hr/><h2><a name="SendBufferSize">SendBufferSize</a> <a name="sendbuffersize">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>TCP buffer size</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>SendBufferSize <em>bytes</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="perchild.html">perchild</a></code>, <code><a href="prefork.html">prefork</a></code>, <code><a href="mpm_winnt.html">mpm_winnt</a></code></td></tr></table></td></tr></table>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>The server will set the TCP buffer size to the number of bytes
368bcafaedaee463f769c1b5f3547b9970df90d0slive specified. Very useful to increase past standard OS defaults on
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive high speed high latency (<em>i.e.</em>, 100ms or so, such as
b3137f48abe3090c5531392e57ff0fefd76f59ebnd transcontinental fast pipes).</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive<hr/><h2><a name="ServerLimit">ServerLimit</a> <a name="serverlimit">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Upper limit on configurable number of processes</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>ServerLimit <em>number</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>ServerLimit 256 (prefork), ServerLimit 16 (worker)</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="prefork.html">prefork</a></code></td></tr></table></td></tr></table>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>For the <code><a href="prefork.html">prefork</a></code> MPM, this directive sets the
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive maximum configured value for <a href="#maxclients" class="directive"><code class="directive">MaxClients</code></a> for the lifetime of the
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive Apache process. For the worker MPM, this directive in combination
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive with <a href="#threadlimit" class="directive"><code class="directive">ThreadLimit</code></a> sets
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive the maximum configured value for <a href="#maxclients" class="directive"><code class="directive">MaxClients</code></a> for the lifetime of the
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive Apache process. Any attempts to change this directive during a
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive restart will be ignored, but <a href="#maxclients" class="directive"><code class="directive">MaxClients</code></a> can be modified during
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive a restart.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>Special care must be taken when using this directive. If
b3137f48abe3090c5531392e57ff0fefd76f59ebnd <code class="directive">ServerLimit</code> is set to a value much higher
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive than necessary, extra, unused shared memory will be allocated. If
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive both <code class="directive">ServerLimit</code> and <a href="#maxclients" class="directive"><code class="directive">MaxClients</code></a> are set to values
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive higher than the system can handle, Apache may not start or the
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive system may become unstable.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>With the <code><a href="prefork.html">prefork</a></code> MPM, use this directive only
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive if you need to set <a href="#maxclients" class="directive"><code class="directive">MaxClients</code></a> higher than 256.
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive Do not set the value of this directive any higher than what you
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive might want to set <a href="#maxclients" class="directive"><code class="directive">MaxClients</code></a> to.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
46d1ef8cb385aa2f519ce7d355afc51f144bd938slive <p>With the <code><a href="worker.html">worker</a></code> MPM, use this directive only
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive if your <a href="#maxclients" class="directive"><code class="directive">MaxClients</code></a> and
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <a href="#threadsperchild" class="directive"><code class="directive">ThreadsPerChild</code></a>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive settings require more than 16 server processes. Do not set the
1cb160a981947e75a8353da3fe40a653aa87100eslive value of this directive any higher than the number of server
1cb160a981947e75a8353da3fe40a653aa87100eslive processes required by what you may want for <a href="#maxclients " class="directive"><code class="directive">MaxClients </code></a> and <a href="#threadsperchild" class="directive"><code class="directive">ThreadsPerChild</code></a>.</p>
1cb160a981947e75a8353da3fe40a653aa87100eslive<hr/><h2><a name="StartServers">StartServers</a> <a name="startservers">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Number of child server processes created at startup</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>StartServers <em>number</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>StartServers 5</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code></td></tr></table></td></tr></table>
1cb160a981947e75a8353da3fe40a653aa87100eslive <p>The <code class="directive">StartServers</code> directive sets the
1cb160a981947e75a8353da3fe40a653aa87100eslive number of child server processes created on startup. As the number
1cb160a981947e75a8353da3fe40a653aa87100eslive of processes is dynamically controlled depending on the load,
1cb160a981947e75a8353da3fe40a653aa87100eslive there is usually little reason to adjust this parameter.</p>
b3137f48abe3090c5531392e57ff0fefd76f59ebnd<p><strong>See also </strong></p><ul><li><a href="#minsparethreads" class="directive"><code class="directive">MinSpareThreads</code></a></li><li><a href="#maxsparethreads" class="directive"><code class="directive">MaxSpareThreads</code></a></li></ul><hr/><h2><a name="StartThreads">StartThreads</a> <a name="startthreads">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Nubmer of threads created on startup</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>StartThreads <em>number</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="mpm_netware.html">mpm_netware</a></code>, <code><a href="perchild.html">perchild</a></code></td></tr></table></td></tr></table>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>Number of threads created on startup. As the
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive number of threads is dynamically controlled depending on the
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive load, there is usually little reason to adjust this
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive parameter.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>For <code><a href="perchild.html">perchild</a></code> the default is <code>StartThreads
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive 5</code> and this directive tracks the number of threads per
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive process at startup.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
1cb160a981947e75a8353da3fe40a653aa87100eslive <p>For <code><a href="mpm_netware.html">mpm_netware</a></code> the default is
1cb160a981947e75a8353da3fe40a653aa87100eslive <code>StartThreads 50</code> and, since there is only a single
1cb160a981947e75a8353da3fe40a653aa87100eslive process, this is the total number of threads created at startup to
1cb160a981947e75a8353da3fe40a653aa87100eslive serve requests.</p>
1cb160a981947e75a8353da3fe40a653aa87100eslive
1cb160a981947e75a8353da3fe40a653aa87100eslive<hr/><h2><a name="ThreadLimit">ThreadLimit</a> <a name="threadlimit">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Sets the upper limit on the configurable number of threads
1cb160a981947e75a8353da3fe40a653aa87100esliveper child process</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>ThreadLimit <em>number</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>ThreadLimit 64</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code></td></tr></table></td></tr></table>
1cb160a981947e75a8353da3fe40a653aa87100eslive <p>This directive sets the maximum configured value for <a href="#threadsperchild" class="directive"><code class="directive">ThreadsPerChild</code></a> for the lifetime
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive of the Apache process. Any attempts to change this directive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive during a restart will be ignored, but <a href="#threadsperchild" class="directive"><code class="directive">ThreadsPerChild</code></a> can be modified
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive during a restart up to the value of this directive.</p>
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive
3fa58e00171aebf3b2cfa90035ed530f5b1f651dslive <p>Special care must be taken when using this directive. If
1cb160a981947e75a8353da3fe40a653aa87100eslive <code class="directive">ThreadLimit</code> is set to a value much higher
1cb160a981947e75a8353da3fe40a653aa87100eslive than <a href="#threadsperchild" class="directive"><code class="directive">ThreadsPerChild</code></a>,
1cb160a981947e75a8353da3fe40a653aa87100eslive extra unused shared memory will be allocated. If both
1cb160a981947e75a8353da3fe40a653aa87100eslive <code class="directive">ThreadLimit</code> and <a href="#threadsperchild" class="directive"><code class="directive">ThreadsPerChild</code></a> are set to values
1cb160a981947e75a8353da3fe40a653aa87100eslive higher than the system can handle, Apache may not start or the
1cb160a981947e75a8353da3fe40a653aa87100eslive system may become unstable.</p>
<p>Use this directive only if you need to set <a href="#threadsperchild" class="directive"><code class="directive">ThreadsPerChild</code></a> higher than 64. Do
not set the value of this directive any higher than what you might
want to set <a href="#threadsperchild" class="directive"><code class="directive">ThreadsPerChild</code></a> to.</p>
<hr/><h2><a name="ThreadsPerChild">ThreadsPerChild</a> <a name="threadsperchild">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>Number of threads created by each child process</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>ThreadsPerChild <em>number</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>ThreadsPerChild 50</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="mpm_winnt.html">mpm_winnt</a></code></td></tr></table></td></tr></table>
<p>This directive sets the number of threads created by each
child process. The child creates these threads at startup and
never creates more. If using an MPM like mpmt_winnt, where
there is only one child process, this number should be high
enough to handle the entire load of the server. If using an MPM
like worker, where there are multiple child processes, the
total number of threads should be high enough to handle the
common load on the server.</p>
<hr/><h2><a name="User">User</a> <a name="user">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td>The userid under which the server will answer
requests</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>User <em>unix-userid</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Default" class="help">Default:</a></td><td><code>User #-1</code></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config, virtual host</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>MPM</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td><code><a href="worker.html">worker</a></code>, <code><a href="perchild.html">perchild</a></code>, <code><a href="prefork.html">prefork</a></code></td></tr></table></td></tr></table>
<p>The <code class="directive">User</code> directive sets the userid as
which the server will answer requests. In order to use this
directive, the standalone server must be run initially as
root. <em>Unix-userid</em> is one of:</p>
<dl>
<dt>A username</dt>
<dd>Refers to the given user by name.</dd>
<dt># followed by a user number.</dt>
<dd>Refers to a user by their number.</dd>
</dl>
<p>The user should have no privileges that result in it being
able to access files that are not intended to be visible to the
outside world, and similarly, the user should not be able to
execute code that is not meant for httpd requests. It is
recommended that you set up a new user and group specifically for
running the server. Some admins use user <code>nobody</code>, but
this is not always desirable, since the <code>nobody</code> user
can have other uses on the system.</p>
<p>Notes: If you start the server as a non-root user, it will
fail to change to the lesser privileged user, and will instead
continue to run as that original user. If you do start the
server as root, then it is normal for the parent process to
remain running as root.</p>
<p>Special note: Use of this directive in <a href="core.html#virtualhost" class="directive"><code class="directive">&lt;VirtualHost&gt;</code></a> is no longer supported. To
configure your server for <a href="mod_suexec.html">suexec</a> use
<a href="mod_suexec.html#suexecusergroup" class="directive"><code class="directive">SuexecUserGroup</code></a>.</p>
<blockquote><table><tr><td bgcolor="#e0e5f5"><p align="center"><strong>Security</strong></p> <p>Don't set <code class="directive">User</code>
(or <a href="#group" class="directive"><code class="directive">Group</code></a>) to
<code>root</code> unless you know exactly what you are doing, and what
the dangers are.</p></td></tr></table></blockquote>
<hr/></blockquote><h3 align="center">Apache HTTP Server Version 2.0</h3><a href="./"><img src="/images/index.gif" alt="Index"/></a><a href="../"><img src="/images/home.gif" alt="Home"/></a></body></html>