worker.html revision 5110ced9e3ae72d8eb8e416fdca22ae3ce0fae78
1281N/A<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
1186N/A "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1186N/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" />
1281N/A
0N/A <title>Apache MPM worker</title>
0N/A </head>
0N/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" -->
0N/A
0N/A <h1 align="CENTER">Multi-Processing Module worker</h1>
0N/A
0N/A <p>This Multi-Processing Module implements a hybrid
0N/A multi-threaded multi-process web server.</p>
0N/A
1164N/A <p><a href="module-dict.html#Status"
1186N/A rel="Help"><strong>Status:</strong></a> MPM<br />
98N/A <a href="module-dict.html#SourceFile"
1186N/A rel="Help"><strong>Source File:</strong></a> worker.c<br />
1186N/A <a href="module-dict.html#ModuleIdentifier"
1186N/A rel="Help"><strong>Module Identifier:</strong></a>
1186N/A mpm_worker_module</p>
1186N/A
1186N/A <h2>Summary</h2>
58N/A
1186N/A <p>This Multi-Processing Module (MPM) is the default for most
986N/A unix-like operating systems. It implements a hybrid
1186N/A multi-process multi-threaded server. Each process has a fixed
1281N/A number of threads. The server adjusts to handle load by
1281N/A increasing or decreasing the number of processes.</p>
1281N/A
1281N/A <p>A single control process is responsible for launching child
1281N/A processes. Each child process creates a fixed number of threads
1281N/A as specified in the <code>ThreadsPerChild</code> directive. The
1281N/A individual threads then listen for connections and serve them
1281N/A when they arrive.</p>
1281N/A
1281N/A <p>Apache always tries to maintain a pool of <em>spare</em> or
1281N/A idle server threads, which stand ready to serve incoming
1281N/A requests. In this way, clients do not need to wait for a new
1281N/A threads or processes to be created before their requests can be
1281N/A served. Apache assesses the total number of idle threads in all
1281N/A processes, and forks or kills processes to keep this number
1281N/A within the boundaries specified by <code>MinSpareThreads</code>
1281N/A and <code>MaxSpareThreads</code>. Since this process is very
1281N/A self-regulating, it is rarely necessary to modify these
1281N/A directives from their default values. The maximum number of
1281N/A clients that may be served simultaneously is determined by
1186N/A multiplying the maximum number of server processes that will be
1186N/A created (<code>MaxClients</code>) by the number of threads
1186N/A created in each process (<code>ThreadsPerChild</code>).</p>
1281N/A
207N/A <p>While the parent process is usually started as root under
1281N/A Unix in order to bind to port 80, the child processes and
207N/A threads are launched by Apache as a less-privileged user. The
1281N/A <code>User</code> and <code>Group</code> directives are used to
1281N/A set the privileges of the Apache child processes. The child
1281N/A processes must be able to read all the content that will be
1281N/A served, but should have as few privileges beyond that as
1281N/A possible. In addition, unless <a
1281N/A href="/suexec.html">suexec</a> is used, these directives also
1281N/A set the privileges which will be inherited by CGI scripts.</p>
1281N/A
1281N/A <p><code>MaxRequestsPerChild</code> controls how frequently the
1281N/A server recycles processes by killing old ones and launching new
1281N/A ones.</p>
1186N/A
850N/A <p>See also: <a href="/bind.html">Setting which addresses and
1186N/A ports Apache uses</a>.</p>
942N/A
1186N/A <h2>Directives</h2>
0N/A
1281N/A <ul>
1281N/A <li><a
1186N/A href="mpm_common.html#coredumpdirectory">CoreDumpDirectory</a></li>
1186N/A
207N/A <li><a href="mpm_common.html#group">Group</a></li>
1186N/A
1281N/A <li><a href="mpm_common.html#pidfile">PidFile</a></li>
1281N/A
1281N/A <li><a href="mpm_common.html#listen">Listen</a></li>
1281N/A
1281N/A <li><a
1281N/A href="mpm_common.html#listenbacklog">ListenBacklog</a></li>
1281N/A
1281N/A <li><a href="mpm_common.html#lockfile">LockFile</a></li>
1281N/A
1281N/A <li><a href="mpm_common.html#maxclients">MaxClients</a></li>
1281N/A
1281N/A <li><a
1281N/A href="mpm_common.html#maxrequestsperchild">MaxRequestsPerChild</a></li>
1281N/A
1281N/A <li><a
1281N/A href="mpm_common.html#maxsparethreads">MaxSpareThreads</a></li>
1281N/A
1281N/A <li><a
1281N/A href="mpm_common.html#minsparethreads">MinSpareThreads</a></li>
1281N/A
1281N/A <li><a
1281N/A href="mpm_common.html#scoreboardfile">ScoreBoardFile</a></li>
1281N/A
1281N/A <li><a
1186N/A href="mpm_common.html#sendbuffersize">SendBufferSize</a></li>
99N/A
1186N/A <li><a
1281N/A href="mpm_common.html#serverlimit">ServerLimit</a></li>
1281N/A
1281N/A <li><a
1281N/A href="mpm_common.html#startservers">StartServers</a></li>
1281N/A
1281N/A <li><a
1282N/A href="mpm_common.html#threadlimit">ThreadLimit</a></li>
1282N/A
1282N/A <li><a
1282N/A href="mpm_common.html#threadsperchild">ThreadsPerChild</a></li>
1282N/A
1282N/A <li><a href="mpm_common.html#user">User</a></li>
1282N/A </ul>
1282N/A <!--#include virtual="footer.html" -->
1282N/A </body>
1282N/A</html>
1282N/A
1282N/A