2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.xsl"?>
6 <description>Multi-Processing Module implementing a hybrid
7 multi-threaded multi-process web server</description>
9 <sourcefile>worker.c</sourcefile>
10 <identifier>mpm_worker_module</identifier>
13 <p>This Multi-Processing Module (MPM) implements a hybrid
14 multi-process multi-threaded server. Each process has a fixed
15 number of threads. The server adjusts to handle load by
16 increasing or decreasing the number of processes.</p>
18 <p>A single control process is responsible for launching child
19 processes. Each child process creates a fixed number of threads
20 as specified in the <code>ThreadsPerChild</code> directive. The
21 individual threads then listen for connections and serve them
24 <p>Apache always tries to maintain a pool of <em>spare</em> or
25 idle server threads, which stand ready to serve incoming
26 requests. In this way, clients do not need to wait for a new
27 threads or processes to be created before their requests can be
28 served. Apache assesses the total number of idle threads in all
29 processes, and forks or kills processes to keep this number
30 within the boundaries specified by <code>MinSpareThreads</code>
31 and <code>MaxSpareThreads</code>. Since this process is very
32 self-regulating, it is rarely necessary to modify these
33 directives from their default values. The maximum number of
34 clients that may be served simultaneously is determined by
35 multiplying the maximum number of server processes that will be
36 created (<code>MaxClients</code>) by the number of threads
37 created in each process (<code>ThreadsPerChild</code>).</p>
39 <p>While the parent process is usually started as root under
40 Unix in order to bind to port 80, the child processes and
41 threads are launched by Apache as a less-privileged user. The
42 <code>User</code> and <code>Group</code> directives are used to
43 set the privileges of the Apache child processes. The child
44 processes must be able to read all the content that will be
45 served, but should have as few privileges beyond that as
46 possible. In addition, unless <a
47 href="../suexec.html">suexec</a> is used, these directives also
48 set the privileges which will be inherited by CGI scripts.</p>
50 <p><code>MaxRequestsPerChild</code> controls how frequently the
51 server recycles processes by killing old ones and launching new
54 <p>See also: <a href="../bind.html">Setting which addresses and
55 ports Apache uses</a>.</p>
58 <directivesynopsis location="mpm_common"><name>CoreDumpDirectory</name>
60 <directivesynopsis location="mpm_common"><name>Group</name>
62 <directivesynopsis location="mpm_common"><name>PidFile</name>
64 <directivesynopsis location="mpm_common"><name>Listen</name>
66 <directivesynopsis location="mpm_common"><name>ListenBacklog</name>
68 <directivesynopsis location="mpm_common"><name>LockFile</name>
70 <directivesynopsis location="mpm_common"><name>MaxClients</name>
72 <directivesynopsis location="mpm_common"><name>MaxRequestsPerChild</name>
74 <directivesynopsis location="mpm_common"><name>MaxSpareThreads</name>
76 <directivesynopsis location="mpm_common"><name>MinSpareThreads</name>
78 <directivesynopsis location="mpm_common"><name>ScoreBoardFile</name>
80 <directivesynopsis location="mpm_common"><name>SendBufferSize</name>
82 <directivesynopsis location="mpm_common"><name>ServerLimit</name>
84 <directivesynopsis location="mpm_common"><name>StartServers</name>
86 <directivesynopsis location="mpm_common"><name>ThreadLimit</name>
88 <directivesynopsis location="mpm_common"><name>ThreadsPerChild</name>
90 <directivesynopsis location="mpm_common"><name>User</name>