0N/A<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 0N/A <
title>Apache MPM perchild</
title>
6983N/A <!-- Background white, links blue (unvisited), navy (visited), red (active) --> 0N/A <
body bgcolor="#FFFFFF" text="#000000" link="#0000FF" 0N/A vlink="#000080" alink="#FF0000">
6983N/A <
h1 align="CENTER">Multi-Processing Module perchild</
h1>
6983N/A <
p>This Multi-Processing Module allows for daemon processes
0N/A serving requests to be assigned a variety of different
0N/A rel="Help"><
strong>Status:</
strong></
a> MPM<
br />
0N/A rel="Help"><
strong>Module Identifier:</
strong></
a>
0N/A mpm_perchild_module</
p>
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>
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 <
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 <
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 set the privileges which will be inherited by CGI scripts.</
p>
0N/A <
p><
code>MaxRequestsPerChild</
code> controls how frequently the
0N/A server recycles processes by killing old ones and launching new
0N/A <
p>See also: <
a href="/bind.html">Setting which addresses and
0N/A ports Apache uses</
a>.</
p>
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 <!-- XXX: This desperately needs more explanation. --> 0N/A <
li><
a href="#assignuserid">AssignUserID</
a></
li>
0N/A <
li><
a href="#childperuserid">ChildPerUserID</
a></
li>
0N/A <
h2><
a id="assignuserid" name="assignuserid">AssignUserID
4134N/A rel="Help"><
strong>Syntax:</
strong></
a><
br />
0N/A rel="Help"><
strong>Default:</
strong></
a><
br />
0N/A rel="Help"><
strong>Context:</
strong></
a> server config<
br />
0N/A rel="Help"><
strong>Status:</
strong></
a> MPM<
br />
rel="Help"><
strong>Module:</
strong></
a> perchild</
p>
<
p>Tie a virtual host to a specific child process.</
p>
<
h2><
a id="childperuserid" name="childperuserid">ChildPerUserID
rel="Help"><
strong>Syntax:</
strong></
a><
br />
rel="Help"><
strong>Default:</
strong></
a><
br />
rel="Help"><
strong>Context:</
strong></
a> server config<
br />
rel="Help"><
strong>Status:</
strong></
a> MPM<
br />
rel="Help"><
strong>Module:</
strong></
a> perchild</
p>
<
p>Specify a User and Group for a specific child process.</
p>