mpm.html revision 57d0156f7bbd9ea3a72342cf9912aba61d118702
4566N/A<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4566N/A "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4566N/A
4566N/A<html xmlns="http://www.w3.org/1999/xhtml">
4566N/A <head>
4566N/A <meta name="generator" content="HTML Tidy, see www.w3.org" />
4566N/A
4566N/A <title>Apache Multi-Processing Modules (MPMs)</title>
4566N/A </head>
4566N/A <!-- Background white, links blue (unvisited), navy (visited), red (active) -->
4566N/A
4566N/A <body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
4566N/A vlink="#000080" alink="#FF0000">
4566N/A <!--#include virtual="header.html" -->
4566N/A
4566N/A <h1 align="center">Apache Multi-Processing Modules</h1>
4566N/A
4566N/A <p>The Apache HTTP Server is designed to be a powerful and
4566N/A flexible web server that can work on a very wide variety of
4566N/A platforms in a range of different environments. Different
4566N/A platforms and different environments often require different
4566N/A features, or may have different ways of implementing the same
4566N/A feature most efficiently. Apache has always accommodated a wide
4566N/A variety of environments through its modular design. This design
4566N/A allows the webmaster to choose which features will be included
4566N/A in the server by selecting which modules to load either at
4566N/A compile-time or at run-time.</p>
4566N/A
4566N/A <p>Apache 2.0 extends this modular design to the most basic
4566N/A functions of a web server. The server ships with a selection of
4566N/A Multi-Processing Modules (MPMs) which are responsible for
4566N/A binding to network ports on the machine, accepting requests,
4566N/A and dispatching children to handle the requests.</p>
4566N/A
4566N/A <p>Extending the modular design to this level of the server
4566N/A allows two important benefits:</p>
4566N/A
4566N/A <ul>
4566N/A <li>Apache can more cleanly and efficiently support a wide
4566N/A variety of operating systems. In particular, the Windows
4566N/A version of Apache is now much more efficient, since <a
4566N/A href="mod/mpm_winnt.html">mpm_winnt</a> can use native
4566N/A networking features in place of the POSIX layer used in
4566N/A Apache 1.3. This benefit also extends to other operating
systems that implement specialized MPMs.</li>
<li>The server can be better customized for the needs of the
particular site. For example, sites that need a great deal of
scalability can choose to use a threaded MPM like <a
href="mod/threaded.html">threaded</a>, while sites requiring
stability or compatibility with older software can use a <a
href="mod/prefork.html">preforking MPM</a>. In addition,
special features like serving different hosts under different
userids (<a href="mod/perchild.html">perchild</a>) can be
provided.</li>
</ul>
<p>At the user level, MPMs appear much like other Apache
modules. The main difference is that one and only one MPM must
be loaded into the server at any time. The list of available
MPMs appears on the <a href="mod/">module index page</a>.</p>
<h2 align="center">Choosing an MPM</h2>
<p>MPMs must be chosen during configuration, and compiled into
the server. Compilers are capable of optimizing a lot of
functions if threads are used, but only if they know that
threads are being used. Because some MPMs use threads on Unix
and others don't, Apache will always perform better if the MPM
is chosen at configuration time and built into Apache.</p>
<p>To actually choose the desired MPM, use the argument
--with-mpm= <em>NAME</em> with the /configure script.
<em>NAME</em> is the name of the desired MPM.</p>
<p>Once the server has been compiled, it is possible to
determine which MPM was chosen by using <code>/httpd
-l</code>. This command will list every module that is compiled
into the server, including the MPM.</p>
<h2 align="center">MPM Defaults</h2>
<ul>
<li>BeOS: mpmt_beos</li>
<li>OS/2: mpmt_os2</li>
<li>Unix: prefork</li>
<li>Windows: winnt</li>
</ul>
<!--#include virtual="footer.html" -->
</body>
</html>