prefork.xml revision db479b48bd4d75423ed4a45e15b75089d1a8ad72
efa4f29a7761c2123557276566f45c9084e734c6patrikj<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding Licensed to the Apache Software Foundation (ASF) under one or more
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding contributor license agreements. See the NOTICE file distributed with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding this work for additional information regarding copyright ownership.
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding The ASF licenses this file to You under the Apache License, Version 2.0
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding (the "License"); you may not use this file except in compliance with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding the License. You may obtain a copy of the License at
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Unless required by applicable law or agreed to in writing, software
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd distributed under the License is distributed on an "AS IS" BASIS,
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd See the License for the specific language governing permissions and
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd limitations under the License.
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Implements a non-threaded, pre-forking web server</description>
1a9d040bd97b9bacbcb5aead589523bf60572e04slive <p>This Multi-Processing Module (MPM) implements a non-threaded,
1a9d040bd97b9bacbcb5aead589523bf60572e04slive pre-forking web server that handles requests in a manner similar
1a9d040bd97b9bacbcb5aead589523bf60572e04slive to Apache 1.3. It is appropriate for sites that need to avoid
1a9d040bd97b9bacbcb5aead589523bf60572e04slive threading for compatibility with non-thread-safe libraries. It
1a9d040bd97b9bacbcb5aead589523bf60572e04slive is also the best MPM for isolating each request, so that a problem
1a9d040bd97b9bacbcb5aead589523bf60572e04slive with a single request will not affect any other.</p>
1a9d040bd97b9bacbcb5aead589523bf60572e04slive <p>This MPM is very self-regulating, so it is rarely necessary to
1a9d040bd97b9bacbcb5aead589523bf60572e04slive adjust its configuration directives. Most important is that
1a9d040bd97b9bacbcb5aead589523bf60572e04slive <directive module="mpm_common">MaxClients</directive> be big enough to
1a9d040bd97b9bacbcb5aead589523bf60572e04slive handle as many simultaneous requests as you expect to receive, but
1a9d040bd97b9bacbcb5aead589523bf60572e04slive small enough to assure that there is enough physical RAM for all
1a9d040bd97b9bacbcb5aead589523bf60572e04slive processes.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<seealso><a href="/bind.html">Setting which addresses and ports Apache
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>A single control process is responsible for launching child
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive processes which listen for connections and serve them when they
ea8a727ff298d2f5368b55b7ae8d87091ae106e7nd arrive. Apache always tries to maintain several <dfn>spare</dfn>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive or idle server processes, which stand ready to serve incoming
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive requests. In this way, clients do not need to wait for a new
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive child processes to be forked before their requests can be
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive served.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive module="mpm_common">StartServers</directive>,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive module="prefork">MinSpareServers</directive>,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive module="prefork">MaxSpareServers</directive>, and
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive module="mpm_common">MaxClients</directive> regulate how
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive the parent process creates children to serve requests. In general,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive Apache is very self-regulating, so most sites do not need to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive adjust these directives from their default values. Sites which
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive need to serve more than 256 simultaneous requests may need to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive increase <directive module="mpm_common">MaxClients</directive>,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive while sites with limited memory may need to decrease <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">MaxClients</directive> to keep the server from
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive thrashing (swapping memory to disk and back). More information
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive about tuning process creation is provided in the <a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive documentation.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>While the parent process is usually started as <code>root</code>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd under Unix in order to bind to port 80, the child processes are
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd launched by Apache as a less-privileged user. The <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">Group</directive> directives are used to set
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive the privileges of the Apache child processes. The child processes
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive must be able to read all the content that will be served, but
1a9d040bd97b9bacbcb5aead589523bf60572e04slive should have as few privileges beyond that as possible.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p><directive module="mpm_common">MaxRequestsPerChild</directive>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive controls how frequently the server recycles processes by killing
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive old ones and launching new ones.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>CoreDumpDirectory</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd<directivesynopsis location="mpm_common"><name>EnableExceptionHook</name>
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>PidFile</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>Listen</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>ListenBacklog</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>LockFile</name>
1a9d040bd97b9bacbcb5aead589523bf60572e04slive</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>MaxClients</name>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>MaxMemFree</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>MaxRequestsPerChild</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>ScoreBoardFile</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas<directivesynopsis location="mpm_common"><name>ReceiveBufferSize</name>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>SendBufferSize</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>ServerLimit</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>StartServers</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>User</name>
1a9d040bd97b9bacbcb5aead589523bf60572e04slive</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>Group</name>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd</directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<directivesynopsis location="mpm_common"><name>AcceptMutex</name>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Maximum number of idle child server processes</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>MaxSpareServers</directive> directive sets the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive desired maximum number of <em>idle</em> child server processes. An
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive idle process is one which is not handling a request. If there are
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd more than <directive>MaxSpareServers</directive> idle, then the
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd parent process will kill off the excess processes.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Tuning of this parameter should only be necessary on very
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive busy sites. Setting this parameter to a large number is almost
f989aee1278b24f2b6e3a8e3b0935b590349de81jorton always a bad idea. If you are trying to set the value equal to or lower than
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <directive module="prefork">MinSpareServers</directive>, Apache
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd will automatically adjust it to <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="prefork">MinSpareServers</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">StartServers</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Minimum number of idle child server processes</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>MinSpareServers</directive> directive sets the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive desired minimum number of <em>idle</em> child server processes. An
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive idle process is one which is not handling a request. If there are
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd fewer than <directive>MinSpareServers</directive> idle, then the parent
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd process creates new children at a maximum rate of 1 per second.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Tuning of this parameter should only be necessary on very
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive busy sites. Setting this parameter to a large number is almost
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive always a bad idea.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="prefork">MaxSpareServers</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">StartServers</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulesynopsis>