mpm_common.xml revision ea8a727ff298d2f5368b55b7ae8d87091ae106e7
64154a07803c72f624008f5c77de844607fcc5a5patrikj<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>A collection of directives that are implemented by
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivemore than one multi-processing module (MPM)</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>Directory where Apache attempts to
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveswitch before dumping core</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulelist><module>worker</module><module>perchild</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>This controls the directory to which Apache attempts to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive switch before dumping core. The default is in the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive module="core">ServerRoot</directive> directory, however
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive since this should not be writable by the user the server runs
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive as, core dumps won't normally get written. If you want a core
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive dump for debugging, you can use this directive to place it in a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive different location.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>Group under which the server will answer
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliverequests</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context><context>virtual host</context>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulelist><module>worker</module><module>perchild</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>Group</directive> directive sets the group under
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive which the server will answer requests. In order to use this
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive directive, the stand-alone server must be run initially as root.
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>It is recommended that you set up a new group specifically for
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive running the server. Some admins use user <code>nobody</code>,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive but this is not always possible or desirable.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Note: if you start the server as a non-root user, it will
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive fail to change to the specified group, and will instead
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive continue to run as the group of the original user.</p>
412307efbfcb2bb8b991be6ad2557f4d3ac0ce77jerenkrantz <p>Special note: Use of this directive in <VirtualHost> is
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive no longer supported. To implement the <a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive href="/suexec.html">suEXEC wrapper</a> with Apache 2.0, use the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive module="mod_suexec">SuexecUserGroup</directive>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive directive. SECURITY: See <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">User</directive> for a discussion of the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive security considerations.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>File where the server records the process ID
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveof the daemon</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
8d9e1277ec6f82d69d11b18f9619953774e26cc7rbowen<modulelist><module>worker</module><module>perchild</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>PidFile</directive> directive sets the file to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive which the server records the process id of the daemon. If the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive filename does not begin with a slash (/) then it is assumed to be
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive relative to the <directive module="core">ServerRoot</directive>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>It is often useful to be able to send the server a signal,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive so that it closes and then reopens its <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="core">ErrorLog</directive> and TransferLog, and
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive re-reads its configuration files. This is done by sending a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive SIGHUP (kill -1) signal to the process id listed in the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive PidFile.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The PidFile is subject to the same warnings about log file
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive placement and <a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive href="/misc/security_tips.html#serverroot">security</a>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>IP addresses and ports that the server
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivelistens to</description>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd<syntax>Listen [<var>IP-address</var>:]<var>portnumber</var></syntax>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulelist><module>worker</module><module>perchild</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>Listen</directive> directive instructs Apache to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive listen to only specific IP addresses or ports; by default it
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive responds to requests on all IP interfaces. The Listen directive is
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive now a required directive. If it is not in the config file, the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive server will fail to start. This is a change from previous versions
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive of Apache.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The Listen directive tells the server to accept incoming
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive requests on the specified port or address-and-port combination.
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive If only a port number is specified, the server listens to the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive given port on all interfaces. If an IP address is given as well
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive as a port, the server will listen on the given port and
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive interface.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Multiple Listen directives may be used to specify a number
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive of addresses and ports to listen to. The server will respond to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive requests from any of the listed addresses and ports.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>For example, to make the server accept connections on both
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive port 80 and port 8000, use:</p>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen 80<br />
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen 8000
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd </example>
64154a07803c72f624008f5c77de844607fcc5a5patrikj <p>To make the server accept connections on two specified
64154a07803c72f624008f5c77de844607fcc5a5patrikj interfaces and port numbers, use </p>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen 192.170.2.1:80<br />
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen 192.170.2.5:8000
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd </example>
64154a07803c72f624008f5c77de844607fcc5a5patrikj <p>IPv6 addresses must be surrounded in square brackets, as in the
64154a07803c72f624008f5c77de844607fcc5a5patrikj following example:</p>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd Listen [fe80::a00:20ff:fea7:ccea]:80
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd </example>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><a href="/dns-caveats.html">DNS Issues</a></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Maximum length of the queue of pending connections</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulelist><module>worker</module><module>perchild</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The maximum length of the queue of pending connections.
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive Generally no tuning is needed or desired, however on some
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive systems it is desirable to increase this when under a TCP SYN
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive flood attack. See the backlog parameter to the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>This will often be limited to a smaller number by the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive operating system. This varies from OS to OS. Also note that
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive many OSes do not use exactly what is specified as the backlog,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive but use a number based on (but normally larger than) what is
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Location of the accept serialization lock file</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulelist><module>worker</module><module>perchild</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>LockFile</directive> directive sets the path to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive the lockfile used when Apache is compiled with either
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive USE_FCNTL_SERIALIZED_ACCEPT or USE_FLOCK_SERIALIZED_ACCEPT. This
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive directive should normally be left at its default value. The main
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive reason for changing it is if the <code>logs</code> directory is
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive NFS mounted, since <strong>the lockfile must be stored on a local
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive disk</strong>. The PID of the main server process is
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive automatically appended to the filename.</p>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd <p>It is best to avoid putting this file in a world writable directory
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd such as <code>/var/tmp</code> because someone could create a denial of
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive service attack and prevent the server from starting by creating
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive a lockfile with the same name as the one the server will try to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive create.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Maximum number of child processes that will be created
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveto serve requests</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulelist><module>worker</module><module>prefork</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>MaxClients</directive> directive sets the limit
1f5962de2a7436453ab6197268f483f400af0406slive on the number of simultaneous requests that will be served. Any
1f5962de2a7436453ab6197268f483f400af0406slive connection attempts over the <directive>MaxClients</directive>
1f5962de2a7436453ab6197268f483f400af0406slive limit will normally be queued, up to a number based on the
1f5962de2a7436453ab6197268f483f400af0406slive <directive module="mpm_common">ListenBacklog</directive>
1f5962de2a7436453ab6197268f483f400af0406slive directive. Once a child process is freed at the end of a different
1f5962de2a7436453ab6197268f483f400af0406slive request, the connection will then be serviced.</p>
1f5962de2a7436453ab6197268f483f400af0406slive <p>For non-threaded servers (i.e., <module>prefork</module>),
1f5962de2a7436453ab6197268f483f400af0406slive <directive>MaxClients</directive> translates into the maximum
1f5962de2a7436453ab6197268f483f400af0406slive number of child processes that will be launched to serve requests.
1f5962de2a7436453ab6197268f483f400af0406slive The default value is 256; to increase it, you must also raise
1f5962de2a7436453ab6197268f483f400af0406slive <directive module="mpm_common">ServerLimit</directive>.</p>
1f5962de2a7436453ab6197268f483f400af0406slive <p>For threaded servers (i.e., <module>worker</module>),
1f5962de2a7436453ab6197268f483f400af0406slive number of threads that will be available to serve clients.
1f5962de2a7436453ab6197268f483f400af0406slive The default value is 16 multiplied by the value of
1f5962de2a7436453ab6197268f483f400af0406slive <directive module="mpm_common">ThreadsPerChild</directive>.
1f5962de2a7436453ab6197268f483f400af0406slive To increase <directive>MaxClients</directive> to a value
1f5962de2a7436453ab6197268f483f400af0406slive that requires more than 16 processes, you must also
1f5962de2a7436453ab6197268f483f400af0406slive raise <directive module="mpm_common">ServerLimit</directive>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<directivesynopsis>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<description>Maximum amount of memory that the main allocator is allowed
aec7c8cf914c36561c73aee001924daa6ce7a21btrawickto hold without calling free()</description>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<contextlist><context>server config</context></contextlist>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<modulelist><module>worker</module><module>prefork</module>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick</modulelist>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick <p>The <directive>MaxMemFree</directive> directive sets the
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick maximum number of free Kbytes that the main allocator is allowed
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick to hold without calling free(). When not set, or when set to
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick zero, the threshold will be set to unlimited.</p>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Limit on the number of requests that an individual child server
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivewill handle during its life</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulelist><module>worker</module><module>perchild</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>MaxRequestsPerChild</directive> directive sets
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive the limit on the number of requests that an individual child
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive server process will handle. After
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive>MaxRequestsPerChild</directive> requests, the child
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive process will die. If <directive>MaxRequestsPerChild</directive> is
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive 0, then the process will never expire.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Setting <directive>MaxRequestsPerChild</directive> to a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive non-zero limit has two beneficial effects:</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <li>it limits the amount of memory that process can consume
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive by (accidental) memory leakage;</li>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <li>by giving processes a finite lifetime, it helps reduce
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive the number of processes when the server load reduces.</li>
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd <p>For <em>KeepAlive</em> requests, only the first request is counted
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd towards this limit. In effect, it changes the behavior to limit the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Maximum number of idle threads</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Maximum number of idle threads. Different MPMs deal with this
9ccc5ea873440dd766924e16d9dab2989d81a175slive directive differently.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive <code>MaxSpareThreads 10</code>. This MPM monitors the number of
9ccc5ea873440dd766924e16d9dab2989d81a175slive idle threads on a per-child basis. If there are too many idle
9ccc5ea873440dd766924e16d9dab2989d81a175slive threads in that child, the server will begin to kill threads
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive within that child.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive <code>MaxSpareThreads 500</code>. This MPM deals with idle threads
9ccc5ea873440dd766924e16d9dab2989d81a175slive on a server-wide basis. If there are too many idle threads in the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive server then child processes are killed until the number of idle
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive threads is less than this number.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive <code>MaxSpareThreads 100</code>. Since this MPM runs a
9ccc5ea873440dd766924e16d9dab2989d81a175slive single-process, the spare thread count is also server-wide.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">MinSpareThreads</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">StartServers</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Maximum number of threads per child process</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulelist><module>worker</module><module>perchild</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Maximum number of threads per child. For MPMs with a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive variable number of threads per child, this directive sets the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive maximum number of threads that will be created in each child
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive process. To increase this value beyond its default, it is
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive necessary to change the value of the compile-time define
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <code>HARD_THREAD_LIMIT</code> and recompile the server.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Minimum number of idle threads available to handle request
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivespikes</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Minimum number of idle threads to handle request spikes.
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive Different MPMs deal with this directive
9ccc5ea873440dd766924e16d9dab2989d81a175slive differently.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive <code>MinSpareThreads 5</code> and monitors the number of idle
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive threads on a per-child basis. If there aren't enough idle threads
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive in that child, the server will begin to create new threads within
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive that child.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive <p><module>worker</module> uses a default of <code>MinSpareThreads
9ccc5ea873440dd766924e16d9dab2989d81a175slive 250</code> and deals with idle threads on a server-wide basis. If
9ccc5ea873440dd766924e16d9dab2989d81a175slive there aren't enough idle threads in the server then child
9ccc5ea873440dd766924e16d9dab2989d81a175slive processes are created until the number of idle threads is greater
9ccc5ea873440dd766924e16d9dab2989d81a175slive than number.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive <code>MinSpareThreads 10</code> and, since it is a single-process
9ccc5ea873440dd766924e16d9dab2989d81a175slive MPM, tracks this on a server-wide bases.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">MaxSpareThreads</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">StartServers</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Total number of children alive at the same time</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Number of children alive at the same time. MPMs that use
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive this directive do not dynamically create new child processes so
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive this number should be large enough to handle the requests for
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive the entire site.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Location of the file used to store coordination data for
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivethe child processes</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulelist><module>worker</module><module>perchild</module>
9f8fab7d183a8d3bac5e5d08e8000974f5d0e40fjwoolley <p>Apache uses a scoreboard to communicate between its parent
9f8fab7d183a8d3bac5e5d08e8000974f5d0e40fjwoolley and child processes. Some architectures require a file to facilitate
9f8fab7d183a8d3bac5e5d08e8000974f5d0e40fjwoolley this communication. If the file is left unspecified, Apache first
9f8fab7d183a8d3bac5e5d08e8000974f5d0e40fjwoolley attempts to create the scoreboard entirely in memory (using anonymous
9f8fab7d183a8d3bac5e5d08e8000974f5d0e40fjwoolley shared memory) and, failing that, will attempt to create the file on
9f8fab7d183a8d3bac5e5d08e8000974f5d0e40fjwoolley disk (using file-based shared memory). Specifying this directive causes
4a6e2ffe454f97273eff8da1fd5abce89053dd8eaaron Apache to always create the file on the disk.</p>
4a6e2ffe454f97273eff8da1fd5abce89053dd8eaaron <p>File-based shared memory is useful for third-party applications
4a6e2ffe454f97273eff8da1fd5abce89053dd8eaaron that require direct access to the scoreboard.</p>
4a6e2ffe454f97273eff8da1fd5abce89053dd8eaaron <p>If you use a <directive>ScoreBoardFile</directive> then
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive you may see improved speed by placing it on a RAM disk. But be
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive careful that you heed the same warnings about log file placement
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive and <a href="/misc/security_tips.html">security</a>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive href="/stopping.html">Stopping and Restarting Apache</a></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulelist><module>worker</module><module>perchild</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The server will set the TCP buffer size to the number of bytes
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive specified. Very useful to increase past standard OS defaults on
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive high speed high latency (<em>i.e.</em>, 100ms or so, such as
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive transcontinental fast pipes).</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Upper limit on configurable number of processes</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<default>ServerLimit 256 (prefork), ServerLimit 16 (worker)</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulelist><module>worker</module><module>prefork</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>For the <module>prefork</module> MPM, this directive sets the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive maximum configured value for <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">MaxClients</directive> for the lifetime of the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive Apache process. For the worker MPM, this directive in combination
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive with <directive module="mpm_common">ThreadLimit</directive> sets
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive the maximum configured value for <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">MaxClients</directive> for the lifetime of the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive Apache process. Any attempts to change this directive during a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive restart will be ignored, but <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">MaxClients</directive> can be modified during
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive a restart.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Special care must be taken when using this directive. If
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive>ServerLimit</directive> is set to a value much higher
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive than necessary, extra, unused shared memory will be allocated. If
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive both <directive>ServerLimit</directive> and <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">MaxClients</directive> are set to values
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive higher than the system can handle, Apache may not start or the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive system may become unstable.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>With the <module>prefork</module> MPM, use this directive only
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive if you need to set <directive
4540af21d5c24c0cb389de84ad3bf3bc9b956216yoshiki module="mpm_common">MaxClients</directive> higher than 256.
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive Do not set the value of this directive any higher than what you
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive might want to set <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>With the <module>worker</module> MPM, use this directive only
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive if your <directive module="mpm_common">MaxClients</directive> and
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive module="mpm_common">ThreadsPerChild</directive>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive settings require more than 16 server processes. Do not set the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive value of this directive any higher than the number of server
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive processes required by what you may want for <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">MaxClients </directive> and <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Number of child server processes created at startup</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>StartServers</directive> directive sets the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive number of child server processes created on startup. As the number
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive of processes is dynamically controlled depending on the load,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive there is usually little reason to adjust this parameter.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">MinSpareThreads</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">MaxSpareThreads</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
9ccc5ea873440dd766924e16d9dab2989d81a175slive<description>Nubmer of threads created on startup</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
9ccc5ea873440dd766924e16d9dab2989d81a175slive<modulelist><module>mpm_netware</module><module>perchild</module></modulelist>
9ccc5ea873440dd766924e16d9dab2989d81a175slive <p>Number of threads created on startup. As the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive number of threads is dynamically controlled depending on the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive load, there is usually little reason to adjust this
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive parameter.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive <p>For <module>perchild</module> the default is <code>StartThreads
9ccc5ea873440dd766924e16d9dab2989d81a175slive 5</code> and this directive tracks the number of threads per
9ccc5ea873440dd766924e16d9dab2989d81a175slive process at startup.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive <code>StartThreads 50</code> and, since there is only a single
9ccc5ea873440dd766924e16d9dab2989d81a175slive process, this is the total number of threads created at startup to
9ccc5ea873440dd766924e16d9dab2989d81a175slive serve requests.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Sets the upper limit on the configurable number of threads
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveper child process</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive<modulelist><module>mpm_winnt</module><module>worker</module></modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>This directive sets the maximum configured value for <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">ThreadsPerChild</directive> for the lifetime
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive of the Apache process. Any attempts to change this directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive during a restart will be ignored, but <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">ThreadsPerChild</directive> can be modified
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive during a restart up to the value of this directive.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Special care must be taken when using this directive. If
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive>ThreadLimit</directive> is set to a value much higher
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive than <directive module="mpm_common">ThreadsPerChild</directive>,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive extra unused shared memory will be allocated. If both
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">ThreadsPerChild</directive> are set to values
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive higher than the system can handle, Apache may not start or the
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive system may become unstable. Do not set the value of this directive
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive any higher than your greatest predicted setting of <directive
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive module="mpm_common">ThreadsPerChild</directive> for the
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive current run of Apache.</p>
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive <p>The default value for <directive>ThreadLimit</directive> is
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive 64 when used with <module>worker</module> and 1920 when used
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Number of threads created by each child process</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulelist><module>worker</module><module>mpm_winnt</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>This directive sets the number of threads created by each
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive child process. The child creates these threads at startup and
4540af21d5c24c0cb389de84ad3bf3bc9b956216yoshiki never creates more. If using an MPM like mpmt_winnt, where
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive there is only one child process, this number should be high
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive enough to handle the entire load of the server. If using an MPM
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive like worker, where there are multiple child processes, the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive total number of threads should be high enough to handle the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive common load on the server.</p>
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive <p>The default value for this directive is 25 when used with
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>The userid under which the server will answer
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliverequests</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context><context>virtual host</context>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<modulelist><module>worker</module><module>perchild</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>User</directive> directive sets the userid as
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive which the server will answer requests. In order to use this
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive directive, the standalone server must be run initially as
bb40fddd3e0d76dbbe4c1235292cc1d93655a70aslive <p>The user should have no privileges that result in it being
bb40fddd3e0d76dbbe4c1235292cc1d93655a70aslive able to access files that are not intended to be visible to the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive outside world, and similarly, the user should not be able to
bb40fddd3e0d76dbbe4c1235292cc1d93655a70aslive execute code that is not meant for httpd requests. It is
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive recommended that you set up a new user and group specifically for
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive running the server. Some admins use user <code>nobody</code>, but
bb40fddd3e0d76dbbe4c1235292cc1d93655a70aslive this is not always desirable, since the <code>nobody</code> user
bb40fddd3e0d76dbbe4c1235292cc1d93655a70aslive can have other uses on the system.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Notes: If you start the server as a non-root user, it will
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive fail to change to the lesser privileged user, and will instead
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive continue to run as that original user. If you do start the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive server as root, then it is normal for the parent process to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive remain running as root.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Special note: Use of this directive in <directive module="core"
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive type="section">VirtualHost</directive> is no longer supported. To
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive configure your server for <a href="mod_suexec.html">suexec</a> use
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive module="mod_suexec">SuexecUserGroup</directive>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<note><title>Security</title> <p>Don't set <directive>User</directive>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive(or <directive module="mpm_common">Group</directive>) to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<code>root</code> unless you know exactly what you are doing, and what
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
4a6e2ffe454f97273eff8da1fd5abce89053dd8eaaron</modulesynopsis>