mpm_common.xml revision 8232302b6fc415a7ef743b65754f7d4240a5a95a
64154a07803c72f624008f5c77de844607fcc5a5patrikj<!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>A collection of directives that are implemented by
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivemore than one multi-processing module (MPM)</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen<description>Directory where Apache HTTP Server attempts to
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveswitch before dumping core</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>prefork</module>
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen <p>This controls the directory to which Apache httpd attempts to
a646b97929695e9b76c128c5bea1284f3fb9203ecovener switch before dumping core. If your operating system is configured to
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim create core files in the working directory of the crashing process,
a646b97929695e9b76c128c5bea1284f3fb9203ecovener <directive>CoreDumpDirectory</directive> is necessary to change working
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim directory from the default <directive module="core">ServerRoot</directive>
a646b97929695e9b76c128c5bea1284f3fb9203ecovener directory, which should not be writable by the user the server runs as.</p>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <p>If you want a core dump for debugging, you can use this directive to
a646b97929695e9b76c128c5bea1284f3fb9203ecovener place it in a different location. This directive has no effect if your
5ea52f06da38b6f80825bb5539c2b713faba3c35rbowen operating system is not configured to write core files to the working directory
5ea52f06da38b6f80825bb5539c2b713faba3c35rbowen of the crashing processes.</p>
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen <p>If Apache httpd starts as root and switches to another user, the
b788b37a6b9b54c07d79d82d2a8ccb0e1b5ee347nd Linux kernel <em>disables</em> core dumps even if the directory is
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen writable for the process. Apache httpd (2.0.46 and later) reenables core dumps
b788b37a6b9b54c07d79d82d2a8ccb0e1b5ee347nd on Linux 2.4 and beyond, but only if you explicitly configure a <directive
61de37121fdb85afc120ce4f95602a13dfd110f4rbowen <p>To enable core-dumping of suid-executables on BSD-systems (such
61de37121fdb85afc120ce4f95602a13dfd110f4rbowen as FreeBSD), set <code>kern.sugid_coredump</code> to 1.
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <p><directive>CoreDumpDirectory</directive> processing only occurs for
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim a select set of fatal signals: SIGFPE, SIGILL, SIGABORT,
a646b97929695e9b76c128c5bea1284f3fb9203ecovener SIGSEGV, and SIGBUS.</p>
a646b97929695e9b76c128c5bea1284f3fb9203ecovener <p>On some operating systems, SIGQUIT also results in a core dump but
a646b97929695e9b76c128c5bea1284f3fb9203ecovener does not go through <directive>CoreDumpDirectory</directive> or
a646b97929695e9b76c128c5bea1284f3fb9203ecovener <directive>EnableExceptionHook</directive> processing, so the core
a646b97929695e9b76c128c5bea1284f3fb9203ecovener location is dictated entirely by the operating system.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd<directivesynopsis>
c14a429adc9ca5470465227e394d7d09e0489c0fnd<description>Enables a hook that runs exception handlers
c14a429adc9ca5470465227e394d7d09e0489c0fndafter a crash</description>
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd<contextlist><context>server config</context></contextlist>
f8aafb8bd93472f7da5a7c158958ee09e4176c8etrawick<modulelist>
b486875444fd9dbe1a7fe6137616639f3e5d6d86nd<compatibility>Available in version 2.0.49 and later</compatibility>
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd <p>For safety reasons this directive is only available if the server was
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd configured with the <code>--enable-exception-hook</code> option. It
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd enables a hook that allows external modules to plug in and do something
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd after a child crashed.</p>
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd <p>There are already two modules, <code>mod_whatkilledus</code> and
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd <code>mod_backtrace</code> that make use of this hook. Please have a
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd look at Jeff Trawick's <a
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd href="http://www.apache.org/~trawick/exception_hook.html"
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd >EnableExceptionHook site</a> for more information about these.</p>
e0bc3354c7c500594dae31ba0ae09818c7fd77c0nd</directivesynopsis>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm<directivesynopsis>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm<description>Specify a timeout after which a gracefully shutdown server
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colmwill exit.</description>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm<syntax>GracefulShutDownTimeout <var>seconds</var></syntax>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm<contextlist><context>server config</context></contextlist>
2a869ee6594f1e3e9039af332cd73f939509483acolm<modulelist><module>prefork</module><module>worker</module>
d7473ba3fbde7fc5c254f44fe515f6cfa765e2f2colm<compatibility>Available in version 2.2 and later</compatibility>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm <p>The <directive>GracefulShutdownTimeout</directive> specifies
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim how many seconds after receiving a "graceful-stop" signal, a
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm server should continue to run, handling the existing connections.</p>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm <p>Setting this value to zero means that the server will wait
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm indefinitely until all remaining requests have been fully served.</p>
734aec2d7d9d1998c7e658f84e8c42ca7a5862d1colm</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>File where the server records the process ID
fc88db23cb4b205f1efea5f5d5ae916589db5a61sliveof the daemon</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>mpm_winnt</module>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<module>mpmt_os2</module><module>prefork</module><module>worker</module>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick</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
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd filename is not absolute then it is assumed to be relative to the
3c1fd6400a826983bf8d9139969d2e1f0180eb8dhumbedooh </highlight>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>It is often useful to be able to send the server a signal,
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd so that it closes and then re-opens its <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive re-reads its configuration files. This is done by sending a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive SIGHUP (kill -1) signal to the process id listed in the
54240e863796e3f085dd1783897201a5d99c33d9nd <p>The <directive>PidFile</directive> is subject to the same
54240e863796e3f085dd1783897201a5d99c33d9nd warnings about log file placement and <a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive href="/misc/security_tips.html#serverroot">security</a>.</p>
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen <p>As of Apache HTTP Server 2, we recommended that you only use the <program>
b3e26602840efbc44504b773a2e54c55dc4fb064rbowen apachectl</program> script, or the init script that your OS provides,
b3e26602840efbc44504b773a2e54c55dc4fb064rbowen for (re-)starting or stopping the server.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
eb2fc080554a5d870ca8f67296256d8781ac0a75slive<description>IP addresses and ports that the server
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivelistens to</description>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<syntax>Listen [<var>IP-address</var>:]<var>portnumber</var> [<var>protocol</var>]</syntax>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
0827bb5e74b4053883d808b205248e8966536665trawick<modulelist><module>mpm_netware</module><module>mpm_winnt</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen<compatibility>Required directive since Apache HTTP Server 2.0<br/>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquernaThe <var>protocol</var> argument was added in 2.1.5</compatibility>
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen <p>The <directive>Listen</directive> directive instructs Apache httpd to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive listen to only specific IP addresses or ports; by default it
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd responds to requests on all IP interfaces. <directive>Listen</directive>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd is 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
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen of Apache httpd.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>The <directive>Listen</directive> directive tells the server to
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd accept incoming requests on the specified port or address-and-port
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd combination. If only a port number is specified, the server listens to
ab93a4c4615ab47c08b7f6058c37d36f9bcb9c30kess the 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>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>Multiple <directive>Listen</directive> directives may be used to
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd specify a number of addresses and ports to listen to. The server will
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd respond to 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>
3c1fd6400a826983bf8d9139969d2e1f0180eb8dhumbedooh </highlight>
64154a07803c72f624008f5c77de844607fcc5a5patrikj <p>To make the server accept connections on two specified
64154a07803c72f624008f5c77de844607fcc5a5patrikj interfaces and port numbers, use </p>
3c1fd6400a826983bf8d9139969d2e1f0180eb8dhumbedoohListen 192.170.2.1:80
3c1fd6400a826983bf8d9139969d2e1f0180eb8dhumbedoohListen 192.170.2.5:8000
3c1fd6400a826983bf8d9139969d2e1f0180eb8dhumbedooh </highlight>
64154a07803c72f624008f5c77de844607fcc5a5patrikj <p>IPv6 addresses must be surrounded in square brackets, as in the
64154a07803c72f624008f5c77de844607fcc5a5patrikj following example:</p>
cf02129aebf73dd0bdf369b172eb481ff76ac5f6colm Listen [2001:db8::a00:20ff:fea7:ccea]:80
3c1fd6400a826983bf8d9139969d2e1f0180eb8dhumbedooh </highlight>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <p>The optional <var>protocol</var> argument is not required for most
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim configurations. If not specified, <code>https</code> is the default for
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim port 443 and <code>http</code> the default for all other ports. The
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna protocol is used to determine which module should handle a request, and
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim to apply protocol specific optimizations with the
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <directive module="core">AcceptFilter</directive> directive.</p>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <p>You only need to set the protocol if you are running on non-standard
f56793983a4c02ae0b0a6b0c4060a2e1dc0e2ee6colm ports. For example, running an <code>https</code> site on port 8443:</p>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna Listen 192.170.2.1:8443 https
3c1fd6400a826983bf8d9139969d2e1f0180eb8dhumbedooh </highlight>
8ebf547c0bfe76d92570d7cec20fa0e1d3d8df00nd Multiple <directive>Listen</directive> directives for the same ip
8ebf547c0bfe76d92570d7cec20fa0e1d3d8df00nd address and port will result in an <code>Address already in use</code>
8ebf547c0bfe76d92570d7cec20fa0e1d3d8df00nd error message.
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><a href="/dns-caveats.html">DNS Issues</a></seealso>
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen<seealso><a href="/bind.html">Setting which addresses and ports Apache HTTP Server
e3c18d181f501fb13debc6ebdf0dd59084cf9e9frbowenhref="http://wiki.apache.org/httpd/CouldNotBindToAddress">Further
e3c18d181f501fb13debc6ebdf0dd59084cf9e9frbowendiscussion of the <code>Address already in use</code> error message,
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Maximum length of the queue of pending connections</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
0827bb5e74b4053883d808b205248e8966536665trawick<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>
bb0681e8b45960956d16c7e3ab629586032f7f32takashi<description>Maximum number of connections that will be processed
bb0681e8b45960956d16c7e3ab629586032f7f32takashisimultaneously</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>prefork</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</modulelist>
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf <p>The <directive>MaxRequestWorkers</directive> directive sets the limit
1f5962de2a7436453ab6197268f483f400af0406slive on the number of simultaneous requests that will be served. Any
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf connection attempts over the <directive>MaxRequestWorkers</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>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>For non-threaded servers (<em>i.e.</em>, <module>prefork</module>),
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf <directive>MaxRequestWorkers</directive> translates into the maximum
1f5962de2a7436453ab6197268f483f400af0406slive number of child processes that will be launched to serve requests.
54240e863796e3f085dd1783897201a5d99c33d9nd The default value is <code>256</code>; to increase it, you must also raise
1f5962de2a7436453ab6197268f483f400af0406slive <directive module="mpm_common">ServerLimit</directive>.</p>
0827bb5e74b4053883d808b205248e8966536665trawick <p>For threaded and hybrid servers (<em>e.g.</em> <module>event</module>
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf or <module>worker</module>) <directive>MaxRequestWorkers</directive> restricts
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd the total number of threads that will be available to serve clients.
0827bb5e74b4053883d808b205248e8966536665trawick For hybrid MPMs the default value is <code>16</code> (<directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd module="mpm_common">ServerLimit</directive>) multiplied by the value of
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd >ThreadsPerChild</directive>). Therefore, to increase <directive
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf >MaxRequestWorkers</directive> to a value that requires more than 16 processes,
7360f54903d78a054a3bbf83fb93cfdcba155f06humbedooh <directive>MaxClients</directive> before version 2.3.13. The old name is still
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf supported.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<directivesynopsis>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<description>Maximum amount of memory that the main allocator is allowed
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>mpm_netware</module>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<module>prefork</module><module>worker</module><module>mpm_winnt</module>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick</modulelist>
ab93a4c4615ab47c08b7f6058c37d36f9bcb9c30kess <p>The <directive>MaxMemFree</directive> directive sets the
021d92af060084e767f197b33c86e12eadaae4c2sf maximum number of free Kbytes that every allocator is allowed
021d92af060084e767f197b33c86e12eadaae4c2sf to hold without calling <code>free()</code>. In threaded MPMs, every
f72e581d2d7b356dcbd305fc98557a3fe7c31bf5covener thread has its own allocator. When set
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd to zero, the threshold will be set to unlimited.</p>
aec7c8cf914c36561c73aee001924daa6ce7a21btrawick</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
be192cefa381d5bae6868034687471754cb43175sf<description>Limit on the number of connections that an individual child server
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivewill handle during its life</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>mpm_netware</module>
f8aafb8bd93472f7da5a7c158958ee09e4176c8etrawick<module>prefork</module><module>worker</module></modulelist>
be192cefa381d5bae6868034687471754cb43175sf<compatibility>Available Apache HTTP Server 2.3.9 and later. The old name
33d5f23c349c0ab05ed4086b2f050d8ef5ec74f4covener<code>MaxRequestsPerChild</code> is still supported.</compatibility>
be192cefa381d5bae6868034687471754cb43175sf <p>The <directive>MaxConnectionsPerChild</directive> directive sets
be192cefa381d5bae6868034687471754cb43175sf the limit on the number of connections that an individual child
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive server process will handle. After
be192cefa381d5bae6868034687471754cb43175sf <directive>MaxConnectionsPerChild</directive> connections, the child
be192cefa381d5bae6868034687471754cb43175sf process will die. If <directive>MaxConnectionsPerChild</directive> is
be192cefa381d5bae6868034687471754cb43175sf <p>Setting <directive>MaxConnectionsPerChild</directive> to a
226ed0ab09d83e4d2cda4231843de41befebfe2cnoodl non-zero value limits the amount of memory that process can consume
226ed0ab09d83e4d2cda4231843de41befebfe2cnoodl by (accidental) memory leakage.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Maximum number of idle threads</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>mpm_netware</module>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<module>mpmt_os2</module><module>worker</module></modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Maximum number of idle threads. Different MPMs deal with this
9ccc5ea873440dd766924e16d9dab2989d81a175slive directive differently.</p>
f8aafb8bd93472f7da5a7c158958ee09e4176c8etrawick <code>MaxSpareThreads 250</code>. This MPM deals with idle threads
f8aafb8bd93472f7da5a7c158958ee09e4176c8etrawick on a server-wide basis. If there are too many idle threads in the
f8aafb8bd93472f7da5a7c158958ee09e4176c8etrawick server then child processes are killed until the number of idle
f8aafb8bd93472f7da5a7c158958ee09e4176c8etrawick threads is less than this number.</p>
9ccc5ea873440dd766924e16d9dab2989d81a175slive single-process, the spare thread count is also server-wide.</p>
c1f462d7c99794eaeaeab3940aa84f36ede3e587bjh <module>mpmt_os2</module> the default value is <code>10</code>.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>The range of the <directive>MaxSpareThreads</directive> value
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen is restricted. Apache httpd will correct the given value automatically
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd according to the following rules:</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <li><module>mpm_netware</module> wants the value to be greater than
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <directive module="mpm_common">MinSpareThreads</directive>.</li>
f8aafb8bd93472f7da5a7c158958ee09e4176c8etrawick <li>For <module>worker</module>, the value must be greater or equal
f8aafb8bd93472f7da5a7c158958ee09e4176c8etrawick to the sum of <directive module="mpm_common">MinSpareThreads</directive>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd and <directive module="mpm_common">ThreadsPerChild</directive>.</li>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">MinSpareThreads</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">StartServers</directive></seealso>
5fe85d8662e07bb4e9dbe9c2d0274e90a3058135rbowen<seealso><directive module="prefork">MaxSpareServers</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Minimum number of idle threads available to handle request
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivespikes</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>mpm_netware</module>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<module>mpmt_os2</module><module>worker</module></modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>Minimum number of idle threads to handle request spikes.
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive Different MPMs deal with this directive
9ccc5ea873440dd766924e16d9dab2989d81a175slive differently.</p>
f8aafb8bd93472f7da5a7c158958ee09e4176c8etrawick <p><module>worker</module> uses a default of <code>MinSpareThreads
f8aafb8bd93472f7da5a7c158958ee09e4176c8etrawick 75</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 <code>MinSpareThreads 10</code> and, since it is a single-process
9ccc5ea873440dd766924e16d9dab2989d81a175slive MPM, tracks this on a server-wide bases.</p>
c1f462d7c99794eaeaeab3940aa84f36ede3e587bjh <module>mpmt_os2</module> the default value is <code>5</code>.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">MaxSpareThreads</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<seealso><directive module="mpm_common">StartServers</directive></seealso>
5fe85d8662e07bb4e9dbe9c2d0274e90a3058135rbowen<seealso><directive module="prefork">MinSpareServers</directive></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Location of the file used to store coordination data for
fc88db23cb4b205f1efea5f5d5ae916589db5a61slivethe child processes</description>
8232302b6fc415a7ef743b65754f7d4240a5a95atrawick<default>ScoreBoardFile apache_runtime_status</default>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>mpm_winnt</module>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<module>prefork</module><module>worker</module></modulelist>
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen <p>Apache HTTP Server uses a scoreboard to communicate between its parent
9f8fab7d183a8d3bac5e5d08e8000974f5d0e40fjwoolley and child processes. Some architectures require a file to facilitate
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen this communication. If the file is left unspecified, Apache httpd 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
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen Apache httpd to always create the file on the disk.</p>
8232302b6fc415a7ef743b65754f7d4240a5a95atrawick <p>If <var>file-path</var> is not an absolute path, the location specified
8232302b6fc415a7ef743b65754f7d4240a5a95atrawick will be relative to the value of
8232302b6fc415a7ef743b65754f7d4240a5a95atrawick <directive module="core">DefaultRuntimeDir</directive>.</p>
3c1fd6400a826983bf8d9139969d2e1f0180eb8dhumbedooh </highlight>
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</directivesynopsis>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas<directivesynopsis>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>mpm_netware</module>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<module>mpm_winnt</module><module>mpmt_os2</module><module>prefork</module>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas <p>The server will set the TCP receive buffer size to the number of
cc934828f4a719743a3387516f6fa71dd2cc88ffstas bytes specified.</p>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas <p>If set to the value of <code>0</code>, the server will use the
cc934828f4a719743a3387516f6fa71dd2cc88ffstas OS default.</p>
cc934828f4a719743a3387516f6fa71dd2cc88ffstas</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>mpm_netware</module>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<module>mpm_winnt</module><module>mpmt_os2</module><module>prefork</module>
25f82ac9fc31b40fe2e7d1b834c7d9124b28cd4drbowen <p>Sets the server's TCP send buffer size to the number of bytes
25f82ac9fc31b40fe2e7d1b834c7d9124b28cd4drbowen specified. It is often useful to set this past the OS's standard
42509468dae14243486e662688326bb0352f2deahumbedooh default value on high speed, high latency connections
25f82ac9fc31b40fe2e7d1b834c7d9124b28cd4drbowen (<em>i.e.</em>, 100ms or so, such as transcontinental fast pipes).</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>If set to the value of <code>0</code>, the server will use the
25f82ac9fc31b40fe2e7d1b834c7d9124b28cd4drbowen default value provided by your OS.</p>
33bed6257f6c61686137661c5553983fd6d7ae16covener <p>Further configuration of your operating system may be required to elicit
33bed6257f6c61686137661c5553983fd6d7ae16covener better performance on high speed, high latency connections.</p>
33bed6257f6c61686137661c5553983fd6d7ae16covener <note> <p> On some operating systems, changes in TCP behavior resulting
33bed6257f6c61686137661c5553983fd6d7ae16covener from a larger <directive>SendBufferSize</directive> may not be seen unless
33bed6257f6c61686137661c5553983fd6d7ae16covener <directive module="core">EnableSendfile</directive> is set to OFF. This
33bed6257f6c61686137661c5553983fd6d7ae16covener interaction applies only to static files.</p> </note>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Upper limit on configurable number of processes</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>prefork</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>For the <module>prefork</module> MPM, this directive sets the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive maximum configured value for <directive
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf module="mpm_common">MaxRequestWorkers</directive> for the lifetime of the
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen Apache httpd process. For the <module>worker</module> MPM, this directive
54240e863796e3f085dd1783897201a5d99c33d9nd in combination with <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive the maximum configured value for <directive
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf module="mpm_common">MaxRequestWorkers</directive> for the lifetime of the
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen Apache httpd process. Any attempts to change this directive during a
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive restart will be ignored, but <directive
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf module="mpm_common">MaxRequestWorkers</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
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf module="mpm_common">MaxRequestWorkers</directive> are set to values
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen higher than the system can handle, Apache httpd 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
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf module="mpm_common">MaxRequestWorkers</directive> higher than 256 (default).
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive Do not set the value of this directive any higher than what you
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive might want to set <directive
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf module="mpm_common">MaxRequestWorkers</directive> to.</p>
f8aafb8bd93472f7da5a7c158958ee09e4176c8etrawick <p>With <module>worker</module>, use this directive only
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf if your <directive module="mpm_common">MaxRequestWorkers</directive> and
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <directive module="mpm_common">ThreadsPerChild</directive>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd settings require more than 16 server processes (default). Do not set
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd the value of this directive any higher than the number of server
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive processes required by what you may want for <directive
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bbsf module="mpm_common">MaxRequestWorkers </directive> and <directive
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>There is a hard limit of <code>ServerLimit 20000</code> compiled
ebfb4ab01e55fba4cb5e4b30be6a8ed71f650deferikabele into the server (for the <module>prefork</module> MPM 200000). This is
ac2d3ad41ad44da6f73b14ca873c67bfbef52c67rbowen intended to avoid nasty effects caused by typos. To increase it
ac2d3ad41ad44da6f73b14ca873c67bfbef52c67rbowen even further past this limit, you will need to modify the value of
ac2d3ad41ad44da6f73b14ca873c67bfbef52c67rbowen MAX_SERVER_LIMIT in the mpm source file and rebuild the server.</p>
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen<seealso><a href="/stopping.html">Stopping and Restarting Apache HTTP Server</a></seealso>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Number of child server processes created at startup</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>mpmt_os2</module>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd</modulelist>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>The <directive>StartServers</directive> directive sets the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive number of child server processes created on startup. As the number
b808c9428473ff74fdbcef4b31edc55b37394b3erbowen of processes is dynamically controlled depending on the load, (see
b808c9428473ff74fdbcef4b31edc55b37394b3erbowen <directive module="mpm_common">MinSpareThreads</directive>,
b808c9428473ff74fdbcef4b31edc55b37394b3erbowen <directive module="mpm_common">MaxSpareThreads</directive>,
b808c9428473ff74fdbcef4b31edc55b37394b3erbowen <directive module="prefork">MinSpareServers</directive>, <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive there is usually little reason to adjust this parameter.</p>
f8aafb8bd93472f7da5a7c158958ee09e4176c8etrawick <p>The default value differs from MPM to MPM. <module>worker</module>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim defaults to <code>StartServers 3</code>; <module>prefork</module>
c1f462d7c99794eaeaeab3940aa84f36ede3e587bjh defaults to <code>5</code>; <module>mpmt_os2</module> defaults to
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd<description>Number of threads created on startup</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
0827bb5e74b4053883d808b205248e8966536665trawick<modulelist><module>mpm_netware</module></modulelist>
9ccc5ea873440dd766924e16d9dab2989d81a175slive <p>Number of threads created on startup. As the
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive number of threads is dynamically controlled depending on the
b032721d8e16c3b680762589b0cd272bf13bea58rbowen <directive module="mpm_common">MinSpareThreads</directive>,
b032721d8e16c3b680762589b0cd272bf13bea58rbowen <directive module="mpm_common">MaxSpareThreads</directive>,
b032721d8e16c3b680762589b0cd272bf13bea58rbowen <directive module="prefork">MinSpareServers</directive>, <directive
b032721d8e16c3b680762589b0cd272bf13bea58rbowen there is usually little reason to adjust this
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive parameter.</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>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>mpm_winnt</module>
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen<compatibility>Available for <module>mpm_winnt</module> in Apache HTTP Server 2.0.41
9cd774340b4867bf4803ab6998450c8d39d0c0c3ndand later</compatibility>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>This directive sets the maximum configured value for <directive
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive module="mpm_common">ThreadsPerChild</directive> for the lifetime
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen of the Apache httpd 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
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen higher than the system can handle, Apache httpd 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
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen current run of Apache httpd.</p>
08f6ab606a643554a8fbd30cf8ae1bb760bdc899slive <p>The default value for <directive>ThreadLimit</directive> is
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>1920</code> when used with <module>mpm_winnt</module> and
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>There is a hard limit of <code>ThreadLimit 20000</code> (or
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>ThreadLimit 15000</code> with <module>mpm_winnt</module>)
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd compiled into the server. This is intended to avoid nasty effects
b032721d8e16c3b680762589b0cd272bf13bea58rbowen caused by typos. To increase it even further past this limit, you
b032721d8e16c3b680762589b0cd272bf13bea58rbowen will need to modify the value of MAX_THREAD_LIMIT in the mpm
b032721d8e16c3b680762589b0cd272bf13bea58rbowen source file and rebuild the server.</p>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<directivesynopsis>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<description>Number of threads created by each child process</description>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>mpm_winnt</module>
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive <p>This directive sets the number of threads created by each
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive child process. The child creates these threads at startup and
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd never creates more. If using an MPM like <module>mpm_winnt</module>,
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd where 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
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd like <module>worker</module>, where there are multiple child processes,
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd the <em>total</em> number of threads should be high enough to handle
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd the common load on the server.</p>
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <p>The default value for <directive>ThreadsPerChild</directive> is
9cd774340b4867bf4803ab6998450c8d39d0c0c3nd <code>64</code> when used with <module>mpm_winnt</module> and
fc88db23cb4b205f1efea5f5d5ae916589db5a61slive</directivesynopsis>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick<directivesynopsis>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim<description>The size in bytes of the stack used by threads handling
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jimclient connections</description>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick<default>65536 on NetWare; varies on other operating systems</default>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick<contextlist><context>server config</context></contextlist>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<modulelist><module>event</module><module>mpm_netware</module>
fb6c0c7c223eff88e1bdb47b3ab85f0d7ee2ca81trawick<module>mpmt_os2</module><module>mpm_winnt</module><module>worker</module>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick</modulelist>
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen<compatibility>Available in Apache HTTP Server 2.1 and later</compatibility>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <p>The <directive>ThreadStackSize</directive> directive sets the
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick size of the stack (for autodata) of threads which handle client
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim connections and call modules to help process those connections.
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim In most cases the operating system default for stack size is
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim reasonable, but there are some conditions where it may need to be
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick adjusted:</p>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick <li>On platforms with a relatively small default thread stack size
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen (e.g., HP-UX), Apache httpd may crash when using some third-party modules
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick which use a relatively large amount of autodata storage. Those
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick same modules may have worked fine on other platforms where the
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick default thread stack size is larger. This type of crash is
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim resolved by setting <directive>ThreadStackSize</directive> to a
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim value higher than the operating system default. This type of
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim adjustment is necessary only if the provider of the third-party
7358d46e702b78ecad1df27f3befe005ef624cc9rbowen module specifies that it is required, or if diagnosis of an Apache httpd
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick crash indicates that the thread stack size was too small.</li>
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <li>On platforms where the default thread stack size is
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick significantly larger than necessary for the web server
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick configuration, a higher number of threads per child process
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick will be achievable if <directive>ThreadStackSize</directive> is
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick set to a value lower than the operating system default. This type
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick of adjustment should only be made in a test environment which allows
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick the full set of web server processing can be exercised, as there
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick may be infrequent requests which require more stack to process.
18ee8bb3db5cc3b04291f89301bd5d14dc271066lgentis The minimum required stack size strongly depends on the modules
581b89048fcac4a2ec31e6fd25c18689bbb2bdc8sf used, but any change in the web server configuration can invalidate
581b89048fcac4a2ec31e6fd25c18689bbb2bdc8sf the current <directive>ThreadStackSize</directive> setting.</li>
5c3ce8eaf29f8ba0519fc29fe6121799a92bd5eecovener <li>On Linux, this directive can only be used to increase the default
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim stack size, as the underlying system call uses the value as a
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <em>minimum</em> stack size. The (often large) soft limit for
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim <code>ulimit -s</code> (8MB if unlimited) is used as the default stack
581b89048fcac4a2ec31e6fd25c18689bbb2bdc8sf <note>It is recommended to not reduce <directive>ThreadStackSize</directive>
581b89048fcac4a2ec31e6fd25c18689bbb2bdc8sf unless a high number of threads per child process is needed. On some
581b89048fcac4a2ec31e6fd25c18689bbb2bdc8sf platforms (including Linux), a setting of 128000 is already too low and
581b89048fcac4a2ec31e6fd25c18689bbb2bdc8sf causes crashes with some common modules.</note>
87ffb6e33f3cbef3b9bb406cc2d27039fa336eaatrawick</directivesynopsis>
19a4850f339153b25a487667acb21ad8cced8825nd</modulesynopsis>