mpm_common.html revision 4fce4d712dcc163130e2fa68c113abe4706b1263
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding BGCOLOR="#FFFFFF"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding TEXT="#000000"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding LINK="#0000FF"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding VLINK="#000080"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding ALINK="#FF0000"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!--#include virtual="header.html" -->
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H1 ALIGN="CENTER">Multi-Processing Module Common Directives</H1>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<P>This file documents directives that are implemented by more
f3091cedd4abeda1026d9117c34e8f625754e8aefieldingthan one multi-processing module (MPM).
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<li><a href="#connectionstatus">ConnectionStatus</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#coredumpdirectory">CoreDumpDirectory</a></li>
64185f9824e42f21ca7b9ae6c004484215c031a7rbb<li><a href="#maxrequestsperchild">MaxRequestsPerChild</a></li>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<li><a href="#maxsparethreads">MaxSpareThreads</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#maxthreadsperchild">MaxThreadsPerChild</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#minsparethreads">MinSpareThreads</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#scoreboardfile">ScoreBoardFile</a></li>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<li><a href="#sendbuffersize">SendBufferSize</a></li>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding<li><a href="#threadsperchild">ThreadsPerChild</a></li>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H2><A NAME="connectionstatus">ConnectionStatus directive</A></H2>
f3091cedd4abeda1026d9117c34e8f625754e8aefielding ConnectionStatus on|off<BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<p>Whether or not to maintain status information on current
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingconnections. If this is off then mod_status will not work properly.</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H2><A NAME="coredumpdirectory">CoreDumpDirectory directive</A></H2>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!--%plaintext <?INDEX {\tt CoreDumpDirectory} directive> -->
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Syntax:</STRONG></A> CoreDumpDirectory <EM>directory</EM><BR>
c53a68af52e2428d833746388b412fb4793759b2trawick><STRONG>Default:</STRONG></A> the same location as ServerRoot<BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>This controls the directory to which Apache attempts to switch
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxbefore dumping core. The default is in the <A
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxHREF="core.html#serverroot">ServerRoot</A> directory, however since
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthis should not be writable by the user the server runs as, core dumps
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingwon't normally get written. If you want a core dump for debugging,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingyou can use this directive to place it in a different location.<P><HR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!--%plaintext <?INDEX {\tt Group} directive> -->
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Syntax:</STRONG></A> Group <EM>unix-group</EM><BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Default:</STRONG></A> <CODE>Group #-1</CODE><BR>
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb><STRONG>Context:</STRONG></A> server config, virtual host<BR>
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb REL="Help"
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb REL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Module:</STRONG></A> threaded, perchild, prefork</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingThe Group directive sets the group under which the server will answer requests.
cccd31fa4a72fe23cc3249c06db181b274a55a69gsteinIn order to use this directive, the stand-alone server must be run initially
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb<DT>A group name
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb<DD>Refers to the given group by name.
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb<DT># followed by a group number.
cccd31fa4a72fe23cc3249c06db181b274a55a69gstein<DD>Refers to a group by its number.
54c358157ff30a1c4f4f8b27f3a687f254afa493wroweIt is recommended that you set up a new group specifically for running the
cccd31fa4a72fe23cc3249c06db181b274a55a69gsteinserver. Some admins use user <CODE>nobody</CODE>, but this is not always
480e6d6e3fbf8fc23af721f430a97afb0012be6ftrawickpossible or desirable.<P>
cccd31fa4a72fe23cc3249c06db181b274a55a69gsteinNote: if you start the server as a non-root user, it will fail to change
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxto the specified group, and will instead continue to run as the group of the
cccd31fa4a72fe23cc3249c06db181b274a55a69gsteinoriginal user. <P>
1860b2b5f1de31f8cf9d95f1b394fe98c8dbfab7rbbSpecial note: Use of this directive in <VirtualHost< is no longer
1860b2b5f1de31f8cf9d95f1b394fe98c8dbfab7rbbsupported. To implement the <A HREF="/suexec.html">suEXEC wrapper</A>
cccd31fa4a72fe23cc3249c06db181b274a55a69gsteinwith Apache 2.0, use the <A HREF=mod_suexec.html#suexecusergroup>
b980ad7fdc218b4855cde9f75a747527f50c554dwroweSuexecUserGroup</A> directive.
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbbSECURITY: See <A HREF="#user">User</A> for a discussion of the security
48d7c43629323c8d5ee9f7bd0d194de0a376b391rbb<!--%plaintext <?INDEX {\tt PidFile} directive> -->
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> PidFile <EM>filename</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Default:</STRONG></A> <CODE>PidFile logs/httpd.pid</CODE><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>The PidFile directive sets the file to which the server records the
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxprocess id of the daemon. If the filename does not begin with a slash
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx(/) then it is assumed to be relative to the <A
cf721750997514b9cbed94bf3672ff6b3e2c2132trawick<p>It is often useful to be able to send the server a signal, so that
48d7c43629323c8d5ee9f7bd0d194de0a376b391rbbit closes and then reopens its <A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingHREF="core.html#errorlog">ErrorLog</A> and TransferLog, and re-reads
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingits configuration files. This is done by sending a SIGHUP (kill -1)
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingsignal to the process id listed in the PidFile.</p>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<p>The PidFile is subject to the same warnings about log file placement and
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<A HREF="/misc/security_tips.html#serverroot">security</A>.</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingListen [<EM>IP-address</EM>:]<EM>port number</EM><BR>
0906f649b3d720299e47ed1148e79051e8941b2adirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<P>The Listen directive instructs Apache to listen to only specific IP
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxaddresses or ports; by default it responds to requests on all IP
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>The Listen directive tells
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthe server to accept incoming requests on the specified port or
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxaddress-and-port combination. If only a port number is specified,
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthe server listens to the given port on all interfaces,
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxinstead of the port given by the <TT>Port</TT> directive. If an IP
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbbaddress is given as well as a port, the server will listen on the
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxgiven port and interface. <P>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxNote that you may still require a <TT>Port</TT> directive so
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingthat URLs that Apache generates that point to your server still
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxMultiple Listen directives may be used
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxto specify a number of addresses and ports to listen to. The server
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxwill respond to requests from any of the listed addresses and
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fieldingFor example, to make the server accept connections on both port
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding80 and port 8000, use:
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding Listen 8000
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingTo make the server accept connections on two specified
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldinginterfaces and port numbers, use
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb Listen 192.170.2.1:80
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx Listen 192.170.2.5:8000
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A HREF="/bind.html">Setting which addresses and ports Apache uses</A><BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<A HREF="http://www.apache.org/info/known_bugs.html#listenbug">Known Bugs</A>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<H2><A NAME="listenbacklog">ListenBacklog directive</A></H2>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Syntax:</STRONG></A> ListenBacklog <EM>backlog</EM><BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx HREF="directive-dict.html#Default"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Default:</STRONG></A> <CODE>ListenBacklog 511</CODE><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
62ba6bde073be4d332ffc9c89768757d3f646da5dirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
62ba6bde073be4d332ffc9c89768757d3f646da5dirkx<P>The maximum length of the queue of pending connections. Generally no
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxtuning is needed or desired, however on some systems it is desirable
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxto increase this when under a TCP SYN flood attack. See
0bcc11df5f030cf62289599a25f5831913a4b438trawickthe backlog parameter to the <CODE>listen(2)</CODE> system call.
0bcc11df5f030cf62289599a25f5831913a4b438trawick<P>This will often be limited to a smaller number by the operating
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingsystem. This varies from OS to OS. Also note that many OSes do not
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxuse exactly what is specified as the backlog, but use a number based on
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx(but normally larger than) what is set.
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> LockFile <EM>filename</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Default:</STRONG></A> <CODE>LockFile logs/accept.lock</CODE><BR>
446b877d2ab69d9bbcd9152a2d54814f05f1c00brbb><STRONG>Module:</STRONG></A> threaded, perchild, prefork</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<p>The LockFile directive sets the path to the lockfile used when
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingApache is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingUSE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxleft at its default value. The main reason for changing it is if
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthe <CODE>logs</CODE> directory is NFS mounted, since <STRONG>the lockfile
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxmust be stored on a local disk</STRONG>. The PID of the main
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxserver process is automatically appended to the filename. <P>
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm<p><STRONG>SECURITY:</STRONG> It is best to avoid putting this file in a
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingworld writable directory such as <CODE>/var/tmp</CODE> because someone
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmcould create a denial of service attack and prevent the server from
06e2d72d72d35442e1ba8cfe9f343ac0fb2b8cffdreidstarting by creating a lockfile with the same name as the one the
30309f86bfd564437654aa822a19cd0cb29ca6f8wroweserver will try to create.</p>
bbe866808ba50d71809ab58bbee377cadf60d3b7dreid<!--%plaintext <?INDEX {\tt MaxClients} directive> -->
be2ca76a08c2fc1695f5b3178d5893f0e92240bftrawick><STRONG>Syntax:</STRONG></A> MaxClients <EM>number</EM><BR>
dcde46ca353d5d66bbac2b8e1135ac828992b808dreid><STRONG>Default:</STRONG></A> <CODE>MaxClients 8</code> (with threads)
dcde46ca353d5d66bbac2b8e1135ac828992b808dreid<P>The MaxClients directive sets the limit on the number of child
dcde46ca353d5d66bbac2b8e1135ac828992b808dreidprocesses that will be created to serve requests. When the server is
be2ca76a08c2fc1695f5b3178d5893f0e92240bftrawickbuilt without threading, no more than this number of clients can be
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingserved simultaneously. To configure more than 256 clients, you must
62ba6bde073be4d332ffc9c89768757d3f646da5dirkx<P>Any connection attempts over the MaxClients limit will normally
62ba6bde073be4d332ffc9c89768757d3f646da5dirkxbe queued, up to a number based on the <A HREF="#listenbacklog">
62ba6bde073be4d332ffc9c89768757d3f646da5dirkxListenBacklog</A> directive. Once a child process is freed at the
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxend of a different request, the connection will then be serviced.</p>
0906f649b3d720299e47ed1148e79051e8941b2adirkx<p>When the server is compiled with threading, then the maximum number
0906f649b3d720299e47ed1148e79051e8941b2adirkxof simultaneous requests that can be served is obtained from the value
f5c43b553ca92a2adc39be43155b26c2b07ac40ctrawickof this directive multiplied by <a
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<H2><A NAME="maxrequestsperchild">MaxRequestsPerChild directive</A></H2>
0906f649b3d720299e47ed1148e79051e8941b2adirkx<!--%plaintext <?INDEX {\tt MaxRequestsPerChild} directive> -->
0906f649b3d720299e47ed1148e79051e8941b2adirkx><STRONG>Syntax:</STRONG></A> MaxRequestsPerChild <EM>number</EM><BR>
0906f649b3d720299e47ed1148e79051e8941b2adirkx HREF="directive-dict.html#Default"
0906f649b3d720299e47ed1148e79051e8941b2adirkx><STRONG>Default:</STRONG></A> <CODE>MaxRequestsPerChild 10000</CODE><BR>
0906f649b3d720299e47ed1148e79051e8941b2adirkx HREF="directive-dict.html#Context"
0906f649b3d720299e47ed1148e79051e8941b2adirkx><STRONG>Module:</STRONG></A> threaded, prefork, perchild, mpm_winnt</p>
0906f649b3d720299e47ed1148e79051e8941b2adirkx<p>The MaxRequestsPerChild directive sets the limit on the number of requests
0906f649b3d720299e47ed1148e79051e8941b2adirkxthat an individual child server process will handle. After MaxRequestsPerChild
0906f649b3d720299e47ed1148e79051e8941b2adirkxrequests, the child process will die. If MaxRequestsPerChild is 0, then
0906f649b3d720299e47ed1148e79051e8941b2adirkxthe process will never expire.<P>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxSetting MaxRequestsPerChild to a non-zero limit has two beneficial effects:
0906f649b3d720299e47ed1148e79051e8941b2adirkx<LI>it limits the amount of memory that process can consume by (accidental)
0906f649b3d720299e47ed1148e79051e8941b2adirkxmemory leakage;
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<LI> by giving processes a finite lifetime, it helps reduce the
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxnumber of processes when the server load reduces.
0906f649b3d720299e47ed1148e79051e8941b2adirkx<P><STRONG>NOTE:</STRONG> For <EM>KeepAlive</EM> requests, only the first
0906f649b3d720299e47ed1148e79051e8941b2adirkxrequest is counted towards this limit. In effect, it changes the
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxbehavior to limit the number of <EM>connections</EM> per child.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H2><A NAME="maxsparethreads">MaxSpareThreads directive</A></H2>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Syntax:</STRONG></A> MaxSpareThreads <EM>number</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Default:</STRONG></A> <CODE>MaxSpareThreads 10 (Perchild) or 500 (threaded) </CODE><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<P>Maximum number of idle threads. Different MPMs deal with this directive
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbbdifferently. Perchild monitor the number of idle threads on a
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxper-child basis. If there are too many idle threads in that child, the server
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fieldingwill begin to kill threads within that child.</P>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<P>threaded deals with idle threads on a server-wide basis. If there are
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxtoo many idle threads in the server then child processes are killed
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxuntil the number of idle threads is less than this number.</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>See also <A HREF="#minsparethreads">MinSpareThreads</A> and
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<H2><A NAME="maxthreadsperchild">MaxThreadsPerChild directive</A></H2>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> MaxThreadsPerChild <EM>number</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Default:</STRONG></A> <CODE>MaxThreadsPerChild 64</code>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<P>Maximum number of threads per child. For MPMs with a variable
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingnumber of threads per child, this directive sets the maximum number of
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingthreads that will be created in each child process. To increase this
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingvalue beyond its default, it is necessary to change the value of
4cd6952360b49b5f229e1d6db699b051f90d403cwrowethe compile-time define <code>HARD_THREAD_LIMIT</code> and recompile
4cd6952360b49b5f229e1d6db699b051f90d403cwrowethe server.</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H2><A NAME="minsparethreads">MinSpareThreads directive</A></H2>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<!--%plaintext <?INDEX {\tt MinSpareServers} directive> -->
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Syntax:</STRONG></A> MinSpareServers <EM>number</EM><BR>
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb HREF="directive-dict.html#Default"
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Default:</STRONG></A> <CODE>MaxSpareThreads 5 (Perchild) or 250 (threaded) </CODE><BR>
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb HREF="directive-dict.html#Context"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<P>Minimum number of idle threads to handle request spikes. Different MPMs
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxdeal with this directive differently. Perchild monitor the number
4cd6952360b49b5f229e1d6db699b051f90d403cwroweof idle threads on a per-child basis. If there aren't enough idle threads in
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxthat child, the server will begin to create new threads within that child.
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx<P>threaded deals with idle threads on a server-wide basis. If there
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingaren't enough idle threads in the server then child processes are created
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldinguntil the number of idle threads is greater than number.</p>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxSee also <A HREF="#maxsparethreads">MaxSpareThreads</A> and
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Syntax:</STRONG></A> NumServers <EM>number</EM><BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx HREF="directive-dict.html#Default"
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Default:</STRONG></A> <CODE>NumServers 2</CODE><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>Number of children alive at the same time. MPMs that use this directive
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxdo not dynamically create new child processes so this number should be
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxlarge enough to handle the requests for the entire site.</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<H2><A NAME="scoreboardfile">ScoreBoardFile directive</A></H2>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe<!--%plaintext <?INDEX {\tt ScoreBoardFile} directive> -->
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> ScoreBoardFile <EM>filename</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Default:</STRONG></A> <CODE>ScoreBoardFile logs/apache_status</CODE>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding HREF="directive-dict.html#Compatibility"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork</p>
9676a1b0eec9cb7934d7a1739f07c346e2e63f16trawick<p>The ScoreBoardFile directive is required on some architectures to place
9676a1b0eec9cb7934d7a1739f07c346e2e63f16trawicka file that the server will use to communicate between its children and
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthe parent. The easiest way to find out if your architecture requires
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxa scoreboard file is to run Apache and see if it creates the file named
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxby the directive. If your architecture requires it then you must ensure
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthat this file is not used at the same time by more than one invocation
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxof Apache.</p>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>If you have to use a ScoreBoardFile then you may see improved speed by
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxplacing it on a RAM disk. But be careful that you heed the same warnings
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxabout log file placement and
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<A HREF="/stopping.html">Stopping and Restarting Apache</A></P>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<H2><A NAME="sendbuffersize">SendBufferSize directive</A></H2>
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding<!--%plaintext <?INDEX {\tt SendBufferSize} directive> -->
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> SendBufferSize <EM>bytes</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork, mpm_winnt</p>
a210c975655ac9771f3cb6db8cbd8d1a2c3caa3fdirkxThe server will set the TCP buffer size to the number of bytes
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxspecified. Very useful to increase past standard OS defaults on high
a210c975655ac9771f3cb6db8cbd8d1a2c3caa3fdirkxspeed high latency (<EM>i.e.</EM>, 100ms or so, such as transcontinental
a210c975655ac9771f3cb6db8cbd8d1a2c3caa3fdirkx<H2><A NAME="startservers">StartServers directive</A></H2>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<!--%plaintext <?INDEX {\tt StartServers} directive> -->
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> StartServers <EM>number</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding><STRONG>Default:</STRONG></A> <CODE>StartServers 5</CODE><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>The StartServers directive sets the number of child server processes created
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxon startup. As the number of processes is dynamically controlled depending
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxon the load, there is usually little reason to adjust this parameter.</P>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe<P>See also <A HREF="#minsparethreads">MinSpareThreads</A> and
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<H2><A NAME="startthreads">StartThreads directive</A></H2>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Syntax:</STRONG></A> StartThreads <EM>number</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
20fb0ba160cf0ca91b3f0f0d552cbe60d92b0449fielding><STRONG>Default:</STRONG></A> <CODE>StartThreads 5</CODE><BR>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<p>Number of threads each child creates on startup. As the number of threads
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxis dynamically controlled depending on the load, there is usually little
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxreason to adjust this parameter.</p>
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowe><STRONG>Syntax:</STRONG></A> ThreadsPerChild <EM>number</EM><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Default"
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb REL="Help"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx><STRONG>Default:</STRONG></A> <CODE>ThreadsPerChild 50</CODE><BR>
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx HREF="directive-dict.html#Context"
51469a0d2057aa24107b6f5a04e145824e10da1fdirkx<P>This directive sets the number of threads created by each child
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxprocess. The child creates these threads at startup and never creates
d80638b1d2cf4b956aff22733d29f6eff05be2e7wrowemore. if using an MPM like mpmt_winnt, where there is only one child process,
51469a0d2057aa24107b6f5a04e145824e10da1fdirkxthis number should be high enough to handle the entire load of the server.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingIf using an MPM like threaded, where there are multiple child processes,
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingthe total number of threads should be high enough to handle the common load
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingon the server.</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!--%plaintext <?INDEX {\tt User} directive> -->
f4a8b04b47f09a21b65646b66b19c9649ff7f03arbb><STRONG>Syntax:</STRONG></A> User <EM>unix-userid</EM><BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Default:</STRONG></A> <CODE>User #-1</CODE><BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Context:</STRONG></A> server config, virtual host<BR>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx><STRONG>Module:</STRONG></A> threaded, perchild, prefork</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingThe User directive sets the userid as which the server will answer requests.
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxIn order to use this directive, the standalone server must be run initially
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb<DT>A username
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb<DD>Refers to the given user by name.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<DT># followed by a user number.
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbb<DD>Refers to a user by their number.
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbbThe user should have no privileges which result in it being able to access
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxfiles which are not intended to be visible to the outside world, and
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingsimilarly, the user should not be able to execute code which is not
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxmeant for httpd requests. It is recommended that you set up a new user and
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxgroup specifically for running the server. Some admins use user
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<CODE>nobody</CODE>, but this is not always possible or desirable.
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxFor example mod_proxy's cache, when enabled, must be accessible to this user
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkx(see <A HREF="mod_proxy.html">mod_proxy's</A> <CODE>CacheRoot</CODE>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxdirective).<P>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxNotes: If you start the server as a non-root user, it will fail to change
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbbto the lesser privileged user, and will instead continue to run as
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxthat original user. If you do start the server as root, then it is normal
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingfor the parent process to remain running as root.<P>
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxSpecial note: Use of this directive in <VirtualHost> is no longer
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxsupported. To configure your server for <A HREF="mod_suexec.html">
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxsuexec</A> use <A HREF="mod_suexec.html#suexecusergroup">SuexecUserGroup</A>.
23b4e2f556ce39696c4e31c6e72893f7489ff8d9dirkxSECURITY: Don't set User (or <A HREF="#group">Group</A>) to
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<CODE>root</CODE> unless you know exactly what you are doing, and what the
3a36c0105198c15925b69c40ff0fc8f83dc34af2rbbdangers are.<P>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!--#include virtual="footer.html" -->