threaded.html revision e3ec3193b69b45923c14915fa3ee3bc1f0215baf
279N/A<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
279N/A<HTML>
279N/A<HEAD>
279N/A<TITLE>Apache MPM threaded</TITLE>
279N/A</HEAD>
279N/A
279N/A<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
279N/A<BODY
279N/A BGCOLOR="#FFFFFF"
279N/A TEXT="#000000"
279N/A LINK="#0000FF"
279N/A VLINK="#000080"
279N/A ALINK="#FF0000"
279N/A>
279N/A<!--#include virtual="header.html" -->
279N/A
279N/A<H1 ALIGN="CENTER">Multi-Processing Module threaded</H1>
279N/A<P>
279N/AThis Multi-Processing Module implements a hybrid multi-threaded
279N/Amulti-process web server.
279N/A</P>
1457N/A
279N/A<P><A
279N/AHREF="module-dict.html#Status"
279N/AREL="Help"
279N/A><STRONG>Status:</STRONG></A> MPM
279N/A<BR>
1604N/A<A
1604N/AHREF="module-dict.html#SourceFile"
279N/AREL="Help"
279N/A><STRONG>Source File:</STRONG></A> threaded.c
279N/A<BR>
844N/A<A
1604N/AHREF="module-dict.html#ModuleIdentifier"
279N/AREL="Help"
279N/A><STRONG>Module Identifier:</STRONG></A> mpm_threaded_module
1273N/A</P>
279N/A
279N/A<H2>Summary</H2>
279N/A
279N/A<p>This Multi-Processing Module (MPM) is the default for most unix-like
279N/Aoperating systems. It implements a hybrid
279N/Amulti-process multi-threaded server. Each process has a fixed number
1604N/Aof threads. The server adjusts to handle load by increasing or
279N/Adecreasing the number of processes.</p>
279N/A
279N/A<p>A single control process is responsible for launching child
279N/Aprocesses. Each child process creates a fixed number of threads as
279N/Aspecified in the <code>ThreadsPerChild</code> directive.
840N/AThe individual threads then listen for connections and
447N/Aserve them when they arrive.</p>
447N/A
447N/A<p>Apache always tries to maintain a pool of <em>spare</em> or idle
447N/Aserver threads, which stand ready to serve incoming requests. In this
447N/Away, clients do not need to wait for a new threads or processes to be
447N/Acreated before their requests can be served. Apache assesses the
447N/Atotal number of idle threads in all processes, and forks or kills
924N/Aprocesses to keep this number within the boundaries specified by
279N/A<code>MinSpareThreads</code> and <code>MaxSpareThreads</code>.
279N/ASince this process is very self-regulating, it is rarely necessary to
279N/Amodify these directives from their default values. The maximum
279N/Anumber of clients that may be served simultaneously is determined
447N/Aby multiplying the maximum number of server processes that
279N/Awill be created (<code>MaxClients</code>) by the number of threads
279N/Acreated in each process (<code>ThreadsPerChild</code>).</p>
279N/A
447N/A<p>While the parent process is usually started as root under Unix in
279N/Aorder to bind to port 80, the child processes and threads are launched
447N/Aby Apache as a less-privileged user. The <code>User</code> and
279N/A<code>Group</code> directives are used to set the privileges of the
279N/AApache child processes. The child processes must be able to read all
279N/Athe content that will be served, but should have as few privileges
279N/Abeyond that as possible. In addition, unless <a
279N/Ahref="/suexec.html">suexec</a> is used, these directives also set
279N/Athe 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>