threaded.html revision e3ec3193b69b45923c14915fa3ee3bc1f0215baf
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
b8d55029467b9f139d081cf38c6d06ff45e742a9nd<HTML>
031b91a62d25106ae69d4693475c79618dd5e884fielding<HEAD>
031b91a62d25106ae69d4693475c79618dd5e884fielding<TITLE>Apache MPM threaded</TITLE>
031b91a62d25106ae69d4693475c79618dd5e884fielding</HEAD>
031b91a62d25106ae69d4693475c79618dd5e884fielding
031b91a62d25106ae69d4693475c79618dd5e884fielding<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
031b91a62d25106ae69d4693475c79618dd5e884fielding<BODY
b8d55029467b9f139d081cf38c6d06ff45e742a9nd BGCOLOR="#FFFFFF"
b8d55029467b9f139d081cf38c6d06ff45e742a9nd TEXT="#000000"
b8d55029467b9f139d081cf38c6d06ff45e742a9nd LINK="#0000FF"
b8d55029467b9f139d081cf38c6d06ff45e742a9nd VLINK="#000080"
b8d55029467b9f139d081cf38c6d06ff45e742a9nd ALINK="#FF0000"
b8d55029467b9f139d081cf38c6d06ff45e742a9nd>
b8d55029467b9f139d081cf38c6d06ff45e742a9nd<!--#include virtual="header.html" -->
b8d55029467b9f139d081cf38c6d06ff45e742a9nd
b8d55029467b9f139d081cf38c6d06ff45e742a9nd<H1 ALIGN="CENTER">Multi-Processing Module threaded</H1>
b8d55029467b9f139d081cf38c6d06ff45e742a9nd<P>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingThis Multi-Processing Module implements a hybrid multi-threaded
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingmulti-process web server.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding</P>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<P><A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingHREF="module-dict.html#Status"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingREL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Status:</STRONG></A> MPM
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingHREF="module-dict.html#SourceFile"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingREL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Source File:</STRONG></A> threaded.c
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<BR>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<A
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingHREF="module-dict.html#ModuleIdentifier"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingREL="Help"
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding><STRONG>Module Identifier:</STRONG></A> mpm_threaded_module
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding</P>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<H2>Summary</H2>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<p>This Multi-Processing Module (MPM) is the default for most unix-like
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingoperating systems. It implements a hybrid
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingmulti-process multi-threaded server. Each process has a fixed number
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingof threads. The server adjusts to handle load by increasing or
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingdecreasing the number of processes.</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<p>A single control process is responsible for launching child
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingprocesses. Each child process creates a fixed number of threads as
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingspecified in the <code>ThreadsPerChild</code> directive.
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingThe individual threads then listen for connections and
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingserve them when they arrive.</p>
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fielding<p>Apache always tries to maintain a pool of <em>spare</em> or idle
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingserver threads, which stand ready to serve incoming requests. In this
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingway, clients do not need to wait for a new threads or processes to be
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingcreated before their requests can be served. Apache assesses the
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingtotal number of idle threads in all processes, and forks or kills
09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1fieldingprocesses to keep this number within the boundaries specified by
<code>MinSpareThreads</code> and <code>MaxSpareThreads</code>.
Since this process is very self-regulating, it is rarely necessary to
modify these directives from their default values. The maximum
number of clients that may be served simultaneously is determined
by multiplying the maximum number of server processes that
will be created (<code>MaxClients</code>) by the number of threads
created in each process (<code>ThreadsPerChild</code>).</p>
<p>While the parent process is usually started as root under Unix in
order to bind to port 80, the child processes and threads are launched
by Apache as a less-privileged user. The <code>User</code> and
<code>Group</code> directives are used to set the privileges of the
Apache child processes. The child processes must be able to read all
the content that will be served, but should have as few privileges
beyond that as possible. In addition, unless <a
href="/suexec.html">suexec</a> is used, these directives also set
the privileges which will be inherited by CGI scripts.</p>
<p><code>MaxRequestsPerChild</code> controls how frequently the server
recycles processes by killing old ones and launching new ones.</p>
<p>See also: <a href="/bind.html">Setting which addresses and ports
Apache uses</a>.</p>
<H2>Directives</H2>
<UL>
<li><a href="mpm_common.html#coredumpdirectory">CoreDumpDirectory</a></li>
<li><a href="mpm_common.html#group">Group</a></li>
<li><a href="mpm_common.html#pidfile">PidFile</a></li>
<li><a href="mpm_common.html#listen">Listen</a></li>
<li><a href="mpm_common.html#listenbacklog">ListenBacklog</a></li>
<li><a href="mpm_common.html#lockfile">LockFile</a></li>
<li><a href="mpm_common.html#maxclients">MaxClients</a></li>
<li><a href="mpm_common.html#maxrequestsperchild">MaxRequestsPerChild</a></li>
<li><a href="mpm_common.html#maxsparethreads">MaxSpareThreads</a></li>
<li><a href="mpm_common.html#minsparethreads">MinSpareThreads</a></li>
<li><a href="mpm_common.html#scoreboardfile">ScoreBoardFile</a></li>
<li><a href="mpm_common.html#sendbuffersize">SendBufferSize</a></li>
<li><a href="mpm_common.html#startservers">StartServers</a></li>
<li><a href="mpm_common.html#threadsperchild">ThreadsPerChild</a></li>
<li><a href="mpm_common.html#user">User</a></li>
</UL>
<!--#include virtual="footer.html" -->
</BODY>
</HTML>