perchild.html revision 2eaf662cbc81e823e8d9aeb8d54e69e63032493e
0N/A<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
0N/A "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
0N/A
0N/A<html xmlns="http://www.w3.org/1999/xhtml">
0N/A <head>
0N/A <meta name="generator" content="HTML Tidy, see www.w3.org" />
0N/A
0N/A <title>Apache MPM perchild</title>
6983N/A </head>
6983N/A <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
0N/A
0N/A <body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
0N/A vlink="#000080" alink="#FF0000">
0N/A <!--#include virtual="header.html" -->
6983N/A
6983N/A <h1 align="CENTER">Multi-Processing Module perchild</h1>
6983N/A
6983N/A <p>This Multi-Processing Module allows for daemon processes
0N/A serving requests to be assigned a variety of different
0N/A userids.</p>
0N/A
0N/A <p><a href="module-dict.html#Status"
0N/A rel="Help"><strong>Status:</strong></a> MPM<br />
3231N/A <a href="module-dict.html#SourceFile"
0N/A rel="Help"><strong>Source File:</strong></a> perchild.c<br />
0N/A <a href="module-dict.html#ModuleIdentifier"
0N/A rel="Help"><strong>Module Identifier:</strong></a>
0N/A mpm_perchild_module</p>
0N/A
4134N/A <h2>Summary</h2>
0N/A
4015N/A <p>This Multi-Processing Module (MPM) implements a hybrid
4015N/A multi-process, multi-threaded web server. A fixed number of
4134N/A processes create threads to handle requests. Fluctuations in
0N/A load are handled by increasing or decreasing the number of
4134N/A threads in each process.</p>
0N/A
338N/A <p>A single control process launches the number of child
0N/A processes indicated by the <code>NumServers</code> directive at
0N/A server startup. Each child process creates threads as specified
0N/A in the <code>StartThreads</code> directive. The individual
0N/A threads then listen for connections and serve them when they
0N/A arrive.</p>
0N/A
0N/A <p>Apache always tries to maintain a pool of <em>spare</em> or
0N/A idle server threads, which stand ready to serve incoming
4015N/A requests. In this way, clients do not need to wait for new
0N/A threads to be created. For each child process, Apache assesses
0N/A the number of idle threads and creates or destroys threads to
0N/A keep this number within the boundaries specified by
0N/A <code>MinSpareThreads</code> and <code>MaxSpareThreads</code>.
0N/A Since this process is very self-regulating, it is rarely
0N/A necessary to modify these directives from their default values.
0N/A The maximum number of clients that may be served simultaneously
0N/A is determined by multiplying the number of server processes
0N/A that will be created (<code>NumServers</code>) by the maximum
0N/A number of threads created in each process
0N/A (<code>MaxThreadsPerChild</code>).</p>
0N/A
0N/A <p>While the parent process is usually started as root under
1618N/A Unix in order to bind to port 80, the child processes and
0N/A threads are launched by Apache as a less-privileged user. The
4134N/A <code>User</code> and <code>Group</code> directives are used to
4015N/A set the privileges of the Apache child processes. The child
0N/A processes must be able to read all the content that will be
4015N/A served, but should have as few privileges beyond that as
0N/A possible. In addition, unless <a
0N/A href="/suexec.html">suexec</a> is used, these directives also
0N/A set the privileges which will be inherited by CGI scripts.</p>
0N/A
0N/A <p><code>MaxRequestsPerChild</code> controls how frequently the
0N/A server recycles processes by killing old ones and launching new
0N/A ones.</p>
0N/A
0N/A <p>See also: <a href="/bind.html">Setting which addresses and
0N/A ports Apache uses</a>.</p>
4134N/A
0N/A <p>In addition it adds the extra ability to specify that
0N/A specific processes should serve requests under different
0N/A userids. These processes can then be associated with specific
0N/A virtual hosts.</p>
0N/A <!-- XXX: This desperately needs more explanation. -->
0N/A
0N/A <h2>Directives</h2>
0N/A
0N/A <ul>
0N/A <li><a href="#assignuserid">AssignUserID</a></li>
0N/A
0N/A <li><a href="#childperuserid">ChildPerUserID</a></li>
4134N/A
0N/A <li><a
0N/A href="mpm_common.html#connectionstatus">ConnectionStatus</a></li>
0N/A
0N/A <li><a
0N/A href="mpm_common.html#coredumpdirectory">CoreDumpDirectory</a></li>
0N/A
0N/A <li><a href="mpm_common.html#group">Group</a></li>
0N/A
0N/A <li><a href="mpm_common.html#pidfile">PidFile</a></li>
0N/A
0N/A <li><a href="mpm_common.html#listen">Listen</a></li>
0N/A
0N/A <li><a
4134N/A href="mpm_common.html#listenbacklog">ListenBacklog</a></li>
0N/A
0N/A <li><a href="mpm_common.html#lockfile">LockFile</a></li>
0N/A
0N/A <li><a
0N/A href="mpm_common.html#maxrequestsperchild">MaxRequestsPerChild</a></li>
0N/A
0N/A <li><a
0N/A href="mpm_common.html#maxsparethreads">MaxSpareThreads</a></li>
0N/A
0N/A <li><a
0N/A href="mpm_common.html#maxthreadsperchild">MaxThreadsPerChild</a></li>
0N/A
0N/A <li><a
0N/A href="mpm_common.html#minsparethreads">MinSpareThreads</a></li>
4134N/A
0N/A <li><a href="mpm_common.html#numservers">NumServers</a></li>
0N/A
0N/A <li><a
0N/A href="mpm_common.html#scoreboardfile">ScoreBoardFile</a></li>
0N/A
0N/A <li><a
0N/A href="mpm_common.html#sendbuffersize">SendBufferSize</a></li>
0N/A
0N/A <li><a
0N/A href="mpm_common.html#startthreads">StartThreads</a></li>
0N/A
0N/A <li><a href="mpm_common.html#user">User</a></li>
0N/A </ul>
0N/A <hr />
0N/A
0N/A <h2><a id="assignuserid" name="assignuserid">AssignUserID
0N/A directive</a></h2>
0N/A
4134N/A <p><a href="directive-dict.html#Syntax"
4134N/A rel="Help"><strong>Syntax:</strong></a><br />
0N/A <a href="directive-dict.html#Default"
0N/A rel="Help"><strong>Default:</strong></a><br />
4134N/A <a href="directive-dict.html#Context"
0N/A rel="Help"><strong>Context:</strong></a> server config<br />
0N/A <a href="directive-dict.html#Status"
0N/A rel="Help"><strong>Status:</strong></a> MPM<br />
<a href="directive-dict.html#Module"
rel="Help"><strong>Module:</strong></a> perchild</p>
<p>Tie a virtual host to a specific child process.</p>
<hr />
<h2><a id="childperuserid" name="childperuserid">ChildPerUserID
directive</a></h2>
<p><a href="directive-dict.html#Syntax"
rel="Help"><strong>Syntax:</strong></a><br />
<a href="directive-dict.html#Default"
rel="Help"><strong>Default:</strong></a><br />
<a href="directive-dict.html#Context"
rel="Help"><strong>Context:</strong></a> server config<br />
<a href="directive-dict.html#Status"
rel="Help"><strong>Status:</strong></a> MPM<br />
<a href="directive-dict.html#Module"
rel="Help"><strong>Module:</strong></a> perchild</p>
<p>Specify a User and Group for a specific child process.</p>
<!--#include virtual="footer.html" -->
</body>
</html>