]> granicus.if.org Git - apache/blob - docs/manual/mod/mpm_common.html.en
update transformation
[apache] / docs / manual / mod / mpm_common.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>mpm_common - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.3</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
19 <div id="path">
20 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache MPM Common Directives</h1>
23 <div class="toplang">
24 <p><span>Available Languages: </span><a href="../de/mod/mpm_common.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
25 <a href="../en/mod/mpm_common.html" title="English">&nbsp;en&nbsp;</a> |
26 <a href="../ja/mod/mpm_common.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
27 <a href="../tr/mod/mpm_common.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
28 </div>
29 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>A collection of directives that are implemented by
30 more than one multi-processing module (MPM)</td></tr>
31 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>MPM</td></tr></table>
32 </div>
33 <div id="quickview"><h3 class="directives">Directives</h3>
34 <ul id="toc">
35 <li><img alt="" src="../images/down.gif" /> <a href="#coredumpdirectory">CoreDumpDirectory</a></li>
36 <li><img alt="" src="../images/down.gif" /> <a href="#enableexceptionhook">EnableExceptionHook</a></li>
37 <li><img alt="" src="../images/down.gif" /> <a href="#gracefulshutdowntimeout">GracefulShutdownTimeout</a></li>
38 <li><img alt="" src="../images/down.gif" /> <a href="#listen">Listen</a></li>
39 <li><img alt="" src="../images/down.gif" /> <a href="#listenbacklog">ListenBackLog</a></li>
40 <li><img alt="" src="../images/down.gif" /> <a href="#maxclients">MaxClients</a></li>
41 <li><img alt="" src="../images/down.gif" /> <a href="#maxconnectionsperchild">MaxConnectionsPerChild</a></li>
42 <li><img alt="" src="../images/down.gif" /> <a href="#maxmemfree">MaxMemFree</a></li>
43 <li><img alt="" src="../images/down.gif" /> <a href="#maxsparethreads">MaxSpareThreads</a></li>
44 <li><img alt="" src="../images/down.gif" /> <a href="#minsparethreads">MinSpareThreads</a></li>
45 <li><img alt="" src="../images/down.gif" /> <a href="#pidfile">PidFile</a></li>
46 <li><img alt="" src="../images/down.gif" /> <a href="#receivebuffersize">ReceiveBufferSize</a></li>
47 <li><img alt="" src="../images/down.gif" /> <a href="#scoreboardfile">ScoreBoardFile</a></li>
48 <li><img alt="" src="../images/down.gif" /> <a href="#sendbuffersize">SendBufferSize</a></li>
49 <li><img alt="" src="../images/down.gif" /> <a href="#serverlimit">ServerLimit</a></li>
50 <li><img alt="" src="../images/down.gif" /> <a href="#startservers">StartServers</a></li>
51 <li><img alt="" src="../images/down.gif" /> <a href="#startthreads">StartThreads</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#threadlimit">ThreadLimit</a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#threadsperchild">ThreadsPerChild</a></li>
54 <li><img alt="" src="../images/down.gif" /> <a href="#threadstacksize">ThreadStackSize</a></li>
55 </ul>
56 </div>
57
58 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
59 <div class="directive-section"><h2><a name="CoreDumpDirectory" id="CoreDumpDirectory">CoreDumpDirectory</a> <a name="coredumpdirectory" id="coredumpdirectory">Directive</a></h2>
60 <table class="directive">
61 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Directory where Apache HTTP Server attempts to
62 switch before dumping core</td></tr>
63 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CoreDumpDirectory <var>directory</var></code></td></tr>
64 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for the default setting</code></td></tr>
65 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
66 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
67 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
68 </table>
69     <p>This controls the directory to which Apache httpd attempts to
70     switch before dumping core. If your operating system is configured to
71     create core files in the working directory of the crashing process, 
72     <code class="directive">CoreDumpDirectory</code> is necessary to change working
73     directory from the default <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code> 
74     directory, which should not be writable by the user the server runs as.</p>
75
76     <p>If you want a core dump for debugging, you can use this directive to 
77     place it in a different location. This directive has no effect if your
78     operating system is not configured to write core files to the working directory
79     of the crashing processes.</p>
80     
81     <div class="note"><h3>Core Dumps on Linux</h3>
82       <p>If Apache httpd starts as root and switches to another user, the
83       Linux kernel <em>disables</em> core dumps even if the directory is
84       writable for the process. Apache httpd (2.0.46 and later) reenables core dumps
85       on Linux 2.4 and beyond, but only if you explicitly configure a <code class="directive">CoreDumpDirectory</code>.</p>
86     </div>
87
88     <div class="note"><h3>Specific signals</h3>
89       <p><code class="directive">CoreDumpDirectory</code> processing only occurs for 
90       a select set of fatal signals: SIGFPE, SIGILL, SIGABORT, 
91       SIGSEGV, and SIGBUS.</p>
92       <p>On some operating systems, SIGQUIT also results in a core dump but
93       does not go through <code class="directive">CoreDumpDirectory</code> or
94       <code class="directive">EnableExceptionHook</code> processing, so the core
95       location is dictated entirely by the operating system.</p>
96     </div>
97
98
99 </div>
100 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
101 <div class="directive-section"><h2><a name="EnableExceptionHook" id="EnableExceptionHook">EnableExceptionHook</a> <a name="enableexceptionhook" id="enableexceptionhook">Directive</a></h2>
102 <table class="directive">
103 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables a hook that runs exception handlers
104 after a crash</td></tr>
105 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableExceptionHook On|Off</code></td></tr>
106 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableExceptionHook Off</code></td></tr>
107 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
108 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
109 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
110 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.49 and later</td></tr>
111 </table>
112     <p>For safety reasons this directive is only available if the server was
113     configured with the <code>--enable-exception-hook</code> option. It
114     enables a hook that allows external modules to plug in and do something
115     after a child crashed.</p>
116     
117     <p>There are already two modules, <code>mod_whatkilledus</code> and
118     <code>mod_backtrace</code> that make use of this hook. Please have a
119     look at Jeff Trawick's <a href="http://www.apache.org/~trawick/exception_hook.html">EnableExceptionHook site</a> for more information about these.</p>
120
121 </div>
122 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
123 <div class="directive-section"><h2><a name="GracefulShutdownTimeout" id="GracefulShutdownTimeout">GracefulShutdownTimeout</a> <a name="gracefulshutdowntimeout" id="gracefulshutdowntimeout">Directive</a></h2>
124 <table class="directive">
125 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Specify a timeout after which a gracefully shutdown server
126 will exit.</td></tr>
127 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>GracefulShutDownTimeout <var>seconds</var></code></td></tr>
128 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>GracefulShutDownTimeout 0</code></td></tr>
129 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
130 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
131 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code>, <code class="module"><a href="../mod/event.html">event</a></code></td></tr>
132 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.2 and later</td></tr>
133 </table>
134     <p>The <code class="directive">GracefulShutdownTimeout</code> specifies
135     how many seconds after receiving a "graceful-stop" signal, a 
136     server should continue to run, handling the existing connections.</p>
137
138     <p>Setting this value to zero means that the server will wait
139     indefinitely until all remaining requests have been fully served.</p>
140
141 </div>
142 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
143 <div class="directive-section"><h2><a name="Listen" id="Listen">Listen</a> <a name="listen" id="listen">Directive</a></h2>
144 <table class="directive">
145 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>IP addresses and ports that the server
146 listens to</td></tr>
147 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Listen [<var>IP-address</var>:]<var>portnumber</var> [<var>protocol</var>]</code></td></tr>
148 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
149 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
150 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code>, <code class="module"><a href="../mod/event.html">event</a></code></td></tr>
151 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Required directive since Apache HTTP Server 2.0<br />
152 The <var>protocol</var> argument was added in 2.1.5</td></tr>
153 </table>
154     <p>The <code class="directive">Listen</code> directive instructs Apache httpd to
155     listen to only specific IP addresses or ports; by default it
156     responds to requests on all IP interfaces. <code class="directive">Listen</code>
157     is now a required directive. If it is not in the config file, the
158     server will fail to start. This is a change from previous versions
159     of Apache httpd.</p>
160
161     <p>The <code class="directive">Listen</code> directive tells the server to
162     accept incoming requests on the specified port or address-and-port
163     combination. If only a port number is specified, the server listens to
164     the given port on all interfaces. If an IP address is given as well
165     as a port, the server will listen on the given port and
166     interface.</p>
167
168     <p>Multiple <code class="directive">Listen</code> directives may be used to
169     specify a number of addresses and ports to listen to. The server will
170     respond to requests from any of the listed addresses and ports.</p>
171
172     <p>For example, to make the server accept connections on both
173     port 80 and port 8000, use:</p>
174
175     <div class="example"><p><code>
176       Listen 80<br />
177       Listen 8000
178     </code></p></div>
179
180     <p>To make the server accept connections on two specified
181     interfaces and port numbers, use </p>
182
183     <div class="example"><p><code>
184       Listen 192.170.2.1:80<br />
185       Listen 192.170.2.5:8000
186     </code></p></div>
187
188     <p>IPv6 addresses must be surrounded in square brackets, as in the
189     following example:</p>
190
191     <div class="example"><p><code>
192       Listen [2001:db8::a00:20ff:fea7:ccea]:80
193     </code></p></div>
194
195     <p>The optional <var>protocol</var> argument is not required for most 
196        configurations. If not specified, <code>https</code> is the default for 
197        port 443 and <code>http</code> the default for all other ports.  The 
198        protocol is used to determine which module should handle a request, and
199        to apply protocol specific optimizations with the 
200        <code class="directive"><a href="../mod/core.html#acceptfilter">AcceptFilter</a></code> directive.</p>
201
202     <p>You only need to set the protocol if you are running on non-standard 
203        ports.  For example, running an <code>https</code> site on port 8443:</p>
204
205     <div class="example"><p><code>
206       Listen 192.170.2.1:8443 https
207     </code></p></div>
208
209     <div class="note"><h3>Error condition</h3>
210       Multiple <code class="directive">Listen</code> directives for the same ip
211       address and port will result in an <code>Address already in use</code>
212       error message.
213     </div>
214
215
216 <h3>See also</h3>
217 <ul>
218 <li><a href="../dns-caveats.html">DNS Issues</a></li>
219 <li><a href="../bind.html">Setting which addresses and ports Apache HTTP Server
220     uses</a></li>
221 <li><a href="http://wiki.apache.org/httpd/CouldNotBindToAddress">Further
222 discussion of the <code>Address already in use</code> error message,
223 including other causes.</a></li>
224 </ul>
225 </div>
226 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
227 <div class="directive-section"><h2><a name="ListenBackLog" id="ListenBackLog">ListenBackLog</a> <a name="listenbacklog" id="listenbacklog">Directive</a></h2>
228 <table class="directive">
229 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum length of the queue of pending connections</td></tr>
230 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ListenBacklog <var>backlog</var></code></td></tr>
231 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ListenBacklog 511</code></td></tr>
232 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
233 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
234 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
235 </table>
236     <p>The maximum length of the queue of pending connections.
237     Generally no tuning is needed or desired, however on some
238     systems it is desirable to increase this when under a TCP SYN
239     flood attack. See the backlog parameter to the
240     <code>listen(2)</code> system call.</p>
241
242     <p>This will often be limited to a smaller number by the
243     operating system. This varies from OS to OS. Also note that
244     many OSes do not use exactly what is specified as the backlog,
245     but use a number based on (but normally larger than) what is
246     set.</p>
247
248 </div>
249 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
250 <div class="directive-section"><h2><a name="MaxClients" id="MaxClients">MaxClients</a> <a name="maxclients" id="maxclients">Directive</a></h2>
251 <table class="directive">
252 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum number of connections that will be processed
253 simultaneously</td></tr>
254 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxClients <var>number</var></code></td></tr>
255 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
256 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
257 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
258 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
259 </table>
260     <p>The <code class="directive">MaxClients</code> directive sets the limit
261     on the number of simultaneous requests that will be served.  Any
262     connection attempts over the <code class="directive">MaxClients</code>
263     limit will normally be queued, up to a number based on the
264     <code class="directive"><a href="#listenbacklog">ListenBacklog</a></code>
265     directive. Once a child process is freed at the end of a different
266     request, the connection will then be serviced.</p>
267
268     <p>For non-threaded servers (<em>i.e.</em>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>),
269     <code class="directive">MaxClients</code> translates into the maximum
270     number of child processes that will be launched to serve requests.
271     The default value is <code>256</code>; to increase it, you must also raise
272     <code class="directive"><a href="#serverlimit">ServerLimit</a></code>.</p>
273
274     <p>For threaded and hybrid servers (<em>e.g.</em> <code class="module"><a href="../mod/event.html">event</a></code>
275     or <code class="module"><a href="../mod/worker.html">worker</a></code>) <code class="directive">MaxClients</code> restricts
276     the total number of threads that will be available to serve clients.
277     For hybrid MPMs the default value is <code>16</code> (<code class="directive"><a href="#serverlimit">ServerLimit</a></code>) multiplied by the value of
278     <code>25</code> (<code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>). Therefore, to increase <code class="directive">MaxClients</code> to a value that requires more than 16 processes,
279     you must also raise <code class="directive"><a href="#serverlimit">ServerLimit</a></code>.</p>
280
281 </div>
282 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
283 <div class="directive-section"><h2><a name="MaxConnectionsPerChild" id="MaxConnectionsPerChild">MaxConnectionsPerChild</a> <a name="maxconnectionsperchild" id="maxconnectionsperchild">Directive</a></h2>
284 <table class="directive">
285 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limit on the number of connections that an individual child server
286 will handle during its life</td></tr>
287 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxConnectionsPerChild <var>number</var></code></td></tr>
288 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MaxConnectionsPerChild 0</code></td></tr>
289 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
290 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
291 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
292 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available Apache HTTP Server 2.3.9 and later. The old name
293 <code>MaxRequestsPerChild</code> is still supported.</td></tr>
294 </table>
295     <p>The <code class="directive">MaxConnectionsPerChild</code> directive sets
296     the limit on the number of connections that an individual child
297     server process will handle. After
298     <code class="directive">MaxConnectionsPerChild</code> connections, the child
299     process will die. If <code class="directive">MaxConnectionsPerChild</code> is
300     <code>0</code>, then the process will never expire.</p>
301
302     <div class="note"><h3>Different default values</h3>
303       <p>The default value for <code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code> and
304       <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code> is <code>0</code>.</p>
305     </div>
306
307     <p>Setting <code class="directive">MaxConnectionsPerChild</code> to a
308     non-zero value limits the amount of memory that process can consume
309     by (accidental) memory leakage.</p>
310
311 </div>
312 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
313 <div class="directive-section"><h2><a name="MaxMemFree" id="MaxMemFree">MaxMemFree</a> <a name="maxmemfree" id="maxmemfree">Directive</a></h2>
314 <table class="directive">
315 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum amount of memory that the main allocator is allowed
316 to hold without calling <code>free()</code></td></tr>
317 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxMemFree <var>KBytes</var></code></td></tr>
318 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MaxMemFree 0</code></td></tr>
319 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
320 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
321 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code>, <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code></td></tr>
322 </table>
323     <p>The <code class="directive">MaxMemFree</code> directive sets the
324     maximum number of free Kbytes that the main allocator is allowed
325     to hold without calling <code>free()</code>. When not set, or when set
326     to zero, the threshold will be set to unlimited.</p>
327
328 </div>
329 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
330 <div class="directive-section"><h2><a name="MaxSpareThreads" id="MaxSpareThreads">MaxSpareThreads</a> <a name="maxsparethreads" id="maxsparethreads">Directive</a></h2>
331 <table class="directive">
332 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum number of idle threads</td></tr>
333 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxSpareThreads <var>number</var></code></td></tr>
334 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
335 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
336 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
337 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
338 </table>
339     <p>Maximum number of idle threads. Different MPMs deal with this
340     directive differently.</p>
341
342     <p>For <code class="module"><a href="../mod/worker.html">worker</a></code>, the default is 
343     <code>MaxSpareThreads 250</code>. This MPM deals with idle threads
344     on a server-wide basis. If there are too many idle threads in the
345     server then child processes are killed until the number of idle
346     threads is less than this number.</p>
347
348     <p>For <code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code> the default is
349     <code>MaxSpareThreads 100</code>. Since this MPM runs a
350     single-process, the spare thread count is also server-wide.</p>
351
352     <p><code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> works
353     similar to <code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>. For
354     <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> the default value is <code>10</code>.</p>
355
356     <div class="note"><h3>Restrictions</h3>
357       <p>The range of the <code class="directive">MaxSpareThreads</code> value
358       is restricted. Apache httpd will correct the given value automatically
359       according to the following rules:</p>
360       <ul>
361         <li><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code> wants the value to be greater than
362         <code class="directive"><a href="#minsparethreads">MinSpareThreads</a></code>.</li>
363
364         <li>For <code class="module"><a href="../mod/worker.html">worker</a></code>, the value must be greater or equal
365         to the sum of <code class="directive"><a href="#minsparethreads">MinSpareThreads</a></code>
366         and <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>.</li>
367       </ul>
368     </div>
369
370 <h3>See also</h3>
371 <ul>
372 <li><code class="directive"><a href="#minsparethreads">MinSpareThreads</a></code></li>
373 <li><code class="directive"><a href="#startservers">StartServers</a></code></li>
374 <li><code class="directive"><a href="../mod/prefork.html#maxspareservers">MaxSpareServers</a></code></li>
375 </ul>
376 </div>
377 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
378 <div class="directive-section"><h2><a name="MinSpareThreads" id="MinSpareThreads">MinSpareThreads</a> <a name="minsparethreads" id="minsparethreads">Directive</a></h2>
379 <table class="directive">
380 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Minimum number of idle threads available to handle request
381 spikes</td></tr>
382 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MinSpareThreads <var>number</var></code></td></tr>
383 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
384 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
385 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
386 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
387 </table>
388     <p>Minimum number of idle threads to handle request spikes.
389     Different MPMs deal with this directive
390     differently.</p>
391
392     <p><code class="module"><a href="../mod/worker.html">worker</a></code> uses a default of <code>MinSpareThreads
393     75</code> and deals with idle threads on a server-wide basis. If
394     there aren't enough idle threads in the server then child
395     processes are created until the number of idle threads is greater
396     than <var>number</var>.</p>
397
398     <p><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code> uses a default of
399     <code>MinSpareThreads 10</code> and, since it is a single-process
400     MPM, tracks this on a server-wide bases.</p>
401
402     <p><code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> works
403     similar to <code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>.  For
404     <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> the default value is <code>5</code>.</p>
405
406 <h3>See also</h3>
407 <ul>
408 <li><code class="directive"><a href="#maxsparethreads">MaxSpareThreads</a></code></li>
409 <li><code class="directive"><a href="#startservers">StartServers</a></code></li>
410 <li><code class="directive"><a href="../mod/prefork.html#minspareservers">MinSpareServers</a></code></li>
411 </ul>
412 </div>
413 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
414 <div class="directive-section"><h2><a name="PidFile" id="PidFile">PidFile</a> <a name="pidfile" id="pidfile">Directive</a></h2>
415 <table class="directive">
416 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>File where the server records the process ID
417 of the daemon</td></tr>
418 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>PidFile <var>filename</var></code></td></tr>
419 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>PidFile logs/httpd.pid</code></td></tr>
420 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
421 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
422 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
423 </table>
424     <p>The <code class="directive">PidFile</code> directive sets the file to
425     which the server records the process id of the daemon. If the
426     filename is not absolute then it is assumed to be relative to the
427     <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code>.</p>
428
429     <div class="example"><h3>Example</h3><p><code>
430       PidFile /var/run/apache.pid
431     </code></p></div>
432
433     <p>It is often useful to be able to send the server a signal,
434     so that it closes and then re-opens its <code class="directive"><a href="../mod/core.html#errorlog">ErrorLog</a></code> and <code class="directive"><a href="../mod/mod_log_config.html#transferlog">TransferLog</a></code>, and
435     re-reads its configuration files. This is done by sending a
436     SIGHUP (kill -1) signal to the process id listed in the
437     <code class="directive">PidFile</code>.</p>
438
439     <p>The <code class="directive">PidFile</code> is subject to the same
440     warnings about log file placement and <a href="../misc/security_tips.html#serverroot">security</a>.</p>
441
442     <div class="note"><h3>Note</h3>
443       <p>As of Apache HTTP Server 2, we recommended that you only use the <code class="program"><a href="../programs/apachectl.html">apachectl</a></code> script, or the init script that your OS provides,
444       for (re-)starting or stopping the server.</p>
445     </div>
446
447 </div>
448 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
449 <div class="directive-section"><h2><a name="ReceiveBufferSize" id="ReceiveBufferSize">ReceiveBufferSize</a> <a name="receivebuffersize" id="receivebuffersize">Directive</a></h2>
450 <table class="directive">
451 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>TCP receive buffer size</td></tr>
452 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ReceiveBufferSize <var>bytes</var></code></td></tr>
453 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ReceiveBufferSize 0</code></td></tr>
454 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
455 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
456 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
457 </table>
458     <p>The server will set the TCP receive buffer size to the number of
459     bytes specified.</p>
460
461     <p>If set to the value of <code>0</code>, the server will use the
462     OS default.</p>
463
464 </div>
465 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
466 <div class="directive-section"><h2><a name="ScoreBoardFile" id="ScoreBoardFile">ScoreBoardFile</a> <a name="scoreboardfile" id="scoreboardfile">Directive</a></h2>
467 <table class="directive">
468 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location of the file used to store coordination data for
469 the child processes</td></tr>
470 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ScoreBoardFile <var>file-path</var></code></td></tr>
471 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ScoreBoardFile logs/apache_status</code></td></tr>
472 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
473 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
474 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
475 </table>
476     <p>Apache HTTP Server uses a scoreboard to communicate between its parent
477     and child processes.  Some architectures require a file to facilitate
478     this communication. If the file is left unspecified, Apache httpd first
479     attempts to create the scoreboard entirely in memory (using anonymous
480     shared memory) and, failing that, will attempt to create the file on
481     disk (using file-based shared memory). Specifying this directive causes
482     Apache httpd to always create the file on the disk.</p>
483
484     <div class="example"><h3>Example</h3><p><code>
485       ScoreBoardFile /var/run/apache_status
486     </code></p></div>
487
488     <p>File-based shared memory is useful for third-party applications
489     that require direct access to the scoreboard.</p>
490
491     <p>If you use a <code class="directive">ScoreBoardFile</code> then
492     you may see improved speed by placing it on a RAM disk. But be
493     careful that you heed the same warnings about log file placement
494     and <a href="../misc/security_tips.html">security</a>.</p>
495
496 <h3>See also</h3>
497 <ul>
498 <li><a href="../stopping.html">Stopping and Restarting
499 Apache HTTP Server</a></li>
500 </ul>
501 </div>
502 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
503 <div class="directive-section"><h2><a name="SendBufferSize" id="SendBufferSize">SendBufferSize</a> <a name="sendbuffersize" id="sendbuffersize">Directive</a></h2>
504 <table class="directive">
505 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>TCP buffer size</td></tr>
506 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SendBufferSize <var>bytes</var></code></td></tr>
507 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SendBufferSize 0</code></td></tr>
508 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
509 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
510 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
511 </table>
512     <p>Sets the server's TCP send buffer size to the number of bytes
513     specified. It is often useful to set this past the OS's standard
514     default value on high speed, high latency conections 
515     (<em>i.e.</em>, 100ms or so, such as transcontinental fast pipes).</p>
516
517     <p>If set to the value of <code>0</code>, the server will use the
518     default value provided by your OS.</p>
519
520 </div>
521 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
522 <div class="directive-section"><h2><a name="ServerLimit" id="ServerLimit">ServerLimit</a> <a name="serverlimit" id="serverlimit">Directive</a></h2>
523 <table class="directive">
524 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Upper limit on configurable number of processes</td></tr>
525 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerLimit <var>number</var></code></td></tr>
526 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
527 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
528 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
529 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
530 </table>
531     <p>For the <code class="module"><a href="../mod/prefork.html">prefork</a></code> MPM, this directive sets the
532     maximum configured value for <code class="directive"><a href="#maxclients">MaxClients</a></code> for the lifetime of the
533     Apache httpd process.  For the <code class="module"><a href="../mod/worker.html">worker</a></code> MPM, this directive
534     in combination with <code class="directive"><a href="#threadlimit">ThreadLimit</a></code> sets
535     the maximum configured value for <code class="directive"><a href="#maxclients">MaxClients</a></code> for the lifetime of the
536     Apache httpd process.  Any attempts to change this directive during a
537     restart will be ignored, but <code class="directive"><a href="#maxclients">MaxClients</a></code> can be modified during
538     a restart.</p>
539
540     <p>Special care must be taken when using this directive.  If
541     <code class="directive">ServerLimit</code> is set to a value much higher
542     than necessary, extra, unused shared memory will be allocated.  If
543     both <code class="directive">ServerLimit</code> and <code class="directive"><a href="#maxclients">MaxClients</a></code> are set to values
544     higher than the system can handle, Apache httpd may not start or the
545     system may become unstable.</p>
546
547     <p>With the <code class="module"><a href="../mod/prefork.html">prefork</a></code> MPM, use this directive only
548     if you need to set <code class="directive"><a href="#maxclients">MaxClients</a></code> higher than 256 (default).
549     Do not set the value of this directive any higher than what you
550     might want to set <code class="directive"><a href="#maxclients">MaxClients</a></code> to.</p>
551
552     <p>With <code class="module"><a href="../mod/worker.html">worker</a></code>, use this directive only
553     if your <code class="directive"><a href="#maxclients">MaxClients</a></code> and
554     <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>
555     settings require more than 16 server processes (default). Do not set
556     the value of this directive any higher than the number of server
557     processes required by what you may want for <code class="directive"><a href="#maxclients ">MaxClients </a></code> and <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>.</p>
558
559     <div class="note"><h3>Note</h3>
560       <p>There is a hard limit of <code>ServerLimit 20000</code> compiled
561       into the server (for the <code class="module"><a href="../mod/prefork.html">prefork</a></code> MPM 200000). This is
562       intended to avoid nasty effects caused by typos. To increase it
563       even further past this limit, you will need to modify the value of
564       MAX_SERVER_LIMIT in the mpm source file and rebuild the server.</p>
565     </div>
566
567 <h3>See also</h3>
568 <ul>
569 <li><a href="../stopping.html">Stopping and Restarting Apache HTTP Server</a></li>
570 </ul>
571 </div>
572 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
573 <div class="directive-section"><h2><a name="StartServers" id="StartServers">StartServers</a> <a name="startservers" id="startservers">Directive</a></h2>
574 <table class="directive">
575 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of child server processes created at startup</td></tr>
576 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>StartServers <var>number</var></code></td></tr>
577 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
578 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
579 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
580 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
581 </table>
582     <p>The <code class="directive">StartServers</code> directive sets the
583     number of child server processes created on startup. As the number
584     of processes is dynamically controlled depending on the load, (see
585     <code class="directive"><a href="#minsparethreads">MinSpareThreads</a></code>,
586     <code class="directive"><a href="#maxsparethreads">MaxSpareThreads</a></code>,
587     <code class="directive"><a href="../mod/prefork.html#minspareservers">MinSpareServers</a></code>, <code class="directive"><a href="../mod/prefork.html#maxspareservers">MaxSpareServers</a></code>)
588     there is usually little reason to adjust this parameter.</p>
589
590     <p>The default value differs from MPM to MPM. <code class="module"><a href="../mod/worker.html">worker</a></code>
591     defaults to <code>StartServers 3</code>; <code class="module"><a href="../mod/prefork.html">prefork</a></code> 
592     defaults to <code>5</code>; <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code> defaults to
593     <code>2</code>.</p>
594
595 </div>
596 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
597 <div class="directive-section"><h2><a name="StartThreads" id="StartThreads">StartThreads</a> <a name="startthreads" id="startthreads">Directive</a></h2>
598 <table class="directive">
599 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of threads created on startup</td></tr>
600 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>StartThreads <var>number</var></code></td></tr>
601 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
602 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
603 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
604 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code></td></tr>
605 </table>
606     <p>Number of threads created on startup. As the
607     number of threads is dynamically controlled depending on the
608     load, (see
609     <code class="directive"><a href="#minsparethreads">MinSpareThreads</a></code>,
610     <code class="directive"><a href="#maxsparethreads">MaxSpareThreads</a></code>,
611     <code class="directive"><a href="../mod/prefork.html#minspareservers">MinSpareServers</a></code>, <code class="directive"><a href="../mod/prefork.html#maxspareservers">MaxSpareServers</a></code>)
612     there is usually little reason to adjust this
613     parameter.</p>
614
615     <p>For <code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code> the default is
616     <code>StartThreads 50</code> and, since there is only a single
617     process, this is the total number of threads created at startup to
618     serve requests.</p>
619
620 </div>
621 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
622 <div class="directive-section"><h2><a name="ThreadLimit" id="ThreadLimit">ThreadLimit</a> <a name="threadlimit" id="threadlimit">Directive</a></h2>
623 <table class="directive">
624 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the upper limit on the configurable number of threads
625 per child process</td></tr>
626 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ThreadLimit <var>number</var></code></td></tr>
627 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
628 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
629 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
630 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
631 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available for <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code> in Apache HTTP Server 2.0.41
632 and later</td></tr>
633 </table>
634     <p>This directive sets the maximum configured value for <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> for the lifetime
635     of the Apache httpd process.  Any attempts to change this directive
636     during a restart will be ignored, but <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> can be modified
637     during a restart up to the value of this directive.</p>
638
639     <p>Special care must be taken when using this directive.  If
640     <code class="directive">ThreadLimit</code> is set to a value much higher
641     than <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code>,
642     extra unused shared memory will be allocated.  If both
643     <code class="directive">ThreadLimit</code> and <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> are set to values
644     higher than the system can handle, Apache httpd may not start or the
645     system may become unstable. Do not set the value of this directive
646     any higher than your greatest predicted setting of <code class="directive"><a href="#threadsperchild">ThreadsPerChild</a></code> for the
647     current run of Apache httpd.</p>
648
649     <p>The default value for <code class="directive">ThreadLimit</code> is
650     <code>1920</code> when used with <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code> and
651     <code>64</code> when used with the others.</p>
652
653     <div class="note"><h3>Note</h3>
654       <p>There is a hard limit of <code>ThreadLimit 20000</code> (or
655       <code>ThreadLimit 15000</code> with <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>)
656       compiled into the server. This is intended to avoid nasty effects
657       caused by typos. To increase it even further past this limit, you
658       will need to modify the value of MAX_THREAD_LIMIT in the mpm
659       source file and rebuild the server.</p>
660     </div>
661
662 </div>
663 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
664 <div class="directive-section"><h2><a name="ThreadsPerChild" id="ThreadsPerChild">ThreadsPerChild</a> <a name="threadsperchild" id="threadsperchild">Directive</a></h2>
665 <table class="directive">
666 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of threads created by each child process</td></tr>
667 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ThreadsPerChild <var>number</var></code></td></tr>
668 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>See usage for details</code></td></tr>
669 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
670 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
671 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code></td></tr>
672 </table>
673     <p>This directive sets the number of threads created by each
674     child process. The child creates these threads at startup and
675     never creates more. If using an MPM like <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>,
676     where there is only one child process, this number should be high
677     enough to handle the entire load of the server. If using an MPM
678     like <code class="module"><a href="../mod/worker.html">worker</a></code>, where there are multiple child processes,
679     the <em>total</em> number of threads should be high enough to handle
680     the common load on the server.</p>
681
682     <p>The default value for <code class="directive">ThreadsPerChild</code> is
683     <code>64</code> when used with <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code> and
684     <code>25</code> when used with the others.</p>
685
686 </div>
687 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
688 <div class="directive-section"><h2><a name="ThreadStackSize" id="ThreadStackSize">ThreadStackSize</a> <a name="threadstacksize" id="threadstacksize">Directive</a></h2>
689 <table class="directive">
690 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>The size in bytes of the stack used by threads handling 
691 client connections</td></tr>
692 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ThreadStackSize <var>size</var></code></td></tr>
693 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>65536 on NetWare; varies on other operating systems</code></td></tr>
694 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
695 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
696 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code>, <code class="module"><a href="../mod/event.html">event</a></code></td></tr>
697 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache HTTP Server 2.1 and later</td></tr>
698 </table>
699     <p>The <code class="directive">ThreadStackSize</code> directive sets the 
700     size of the stack (for autodata) of threads which handle client
701     connections and call modules to help process those connections.  
702     In most cases the operating system default for stack size is 
703     reasonable, but there are some conditions where it may need to be 
704     adjusted:</p>
705
706     <ul>
707       <li>On platforms with a relatively small default thread stack size
708       (e.g., HP-UX), Apache httpd may crash when using some third-party modules
709       which use a relatively large amount of autodata storage.  Those
710       same modules may have worked fine on other platforms where the
711       default thread stack size is larger.  This type of crash is
712       resolved by setting <code class="directive">ThreadStackSize</code> to a 
713       value higher than the operating system default.  This type of 
714       adjustment is necessary only if the provider of the third-party 
715       module specifies that it is required, or if diagnosis of an Apache httpd
716       crash indicates that the thread stack size was too small.</li>
717
718       <li>On platforms where the default thread stack size is 
719       significantly larger than necessary for the web server
720       configuration, a higher number of threads per child process
721       will be achievable if <code class="directive">ThreadStackSize</code> is
722       set to a value lower than the operating system default.  This type
723       of adjustment should only be made in a test environment which allows
724       the full set of web server processing can be exercised, as there
725       may be infrequent requests which require more stack to process.
726       The minumum required stack size strongly depends on the modules
727       used, but any change in the web server configuration can invalidate
728       the current <code class="directive">ThreadStackSize</code> setting.</li>
729     </ul>
730
731     <div class="note">It is recommended to not reduce <code class="directive">ThreadStackSize</code>
732     unless a high number of threads per child process is needed. On some
733     platforms (including Linux), a setting of 128000 is already too low and
734     causes crashes with some common modules.</div>
735
736 </div>
737 </div>
738 <div class="bottomlang">
739 <p><span>Available Languages: </span><a href="../de/mod/mpm_common.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
740 <a href="../en/mod/mpm_common.html" title="English">&nbsp;en&nbsp;</a> |
741 <a href="../ja/mod/mpm_common.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
742 <a href="../tr/mod/mpm_common.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
743 </div><div id="footer">
744 <p class="apache">Copyright 2010 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
745 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
746 </body></html>