mpm.html.en revision 6c0569fdaef723781bbef0b7c8634105a3396b94
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere<TITLE>Apache Multi-Processing Modules (MPMs)</TITLE>
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere BGCOLOR="#FFFFFF"
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere TEXT="#000000"
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen LINK="#0000FF"
2e545ce2450a9953665f701bb05350f0d3f26275nd VLINK="#000080"
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen ALINK="#FF0000"
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere<!--#include virtual="header.html" -->
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere<p>The Apache HTTP Server is designed to be a powerful and flexible
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclereweb server that can work on a very wide variety of platforms in a
3f08db06526d6901aa08c110b5bc7dde6bc39905ndrange of different environments. Different platforms and different
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclereenvironments often require different features, or may have different
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclereways of implementing the same feature most efficiently. Apache has
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclerealways accommodated a wide variety of environments through its modular
e3659090e9bb9934465dbb6c6212ba4c512190b0jfcleredesign. This design allows the webmaster to choose which features
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclerewill be included in the server by selecting which modules to load
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclereeither at compile-time or at run-time.</p>
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen<p>Apache 2.0 extends this modular design to the most basic functions
d474d8ef01ec5c2a09341cd148851ed383c3287crbowenof a web server. The server ships with a selection of
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclereMulti-Processing Modules (MPMs) which are responsible for binding to
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclerenetwork ports on the machine, accepting requests, and dispatching
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclerechildren to handle the requests.</p>
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere<p>Extending the modular design to this level of the server
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclereallows two important benefits:
999942e8e84bcae9b439ab30a040b1b997b343c9gryzor<li>Apache can more cleanly and efficiently support a wide variety of
999942e8e84bcae9b439ab30a040b1b997b343c9gryzoroperating systems. In particular, the Windows version of Apache is
999942e8e84bcae9b439ab30a040b1b997b343c9gryzornow much more efficient, since <a
999942e8e84bcae9b439ab30a040b1b997b343c9gryzorhref="mod/mpm_winnt.html">mpm_winnt</a> can use native networking
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedoohfeatures in place of the POSIX layer used in Apache 1.3. This benefit
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclerealso extends to other operating systems that implement specialized
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere<li>The server can be better customized for the needs of the
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclereparticular site. For example, sites that need a great deal of
fabd4bc0c499704e644a74f78cc3871436824ea0jimscalability can choose to use a threaded MPM like <a
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclerehref="mod/threaded.html">threaded</a>, while sites requiring
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclerestability or compatibility with older software can use a <a
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclerehref="mod/prefork.html">preforking MPM</a>. In addition, special
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclerefeatures like serving different hosts under different userids
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere(<a href="mod/perchild.html">perchild</a>) can be provided.</li>
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere<p>At the user level, MPMs appear much like other Apache modules.
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclereThe main difference is that one and only one MPM must be loaded
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclereinto the server at any time. The list of available MPMs
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclereappears on the <a href="mod/">module index page</a>.</p>
bed3c2e56e8f3328e780200466b9d009093db468sf<p>MPMs must be chosen during configuration, and compiled into the server.
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclereCompilers are capable of optimizing a lot of functions if threads are used,
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclerebut only if they know that threads are being used. Because some MPMs use
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclerethreads on Unix and others don't, Apache will always perform better if the
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclereMPM is chosen at configuration time and built into Apache.</p>
591f748210dc55f2972482dddc84bb6bac61d6b9noodl<p>To actually choose the desired MPM, use the argument --with-mpm=
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere<EM>NAME</EM> with the /configure script. <EM>NAME</EM> is the name of
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclerethe desired MPM.</p>
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere<p>Once the server has been compiled, it is possible to determine which
999942e8e84bcae9b439ab30a040b1b997b343c9gryzorMPM was chosen by using <code>/httpd -l</code>. This command will list
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclereevery module that is compiled into the server, including the MPM.</p>
e3659090e9bb9934465dbb6c6212ba4c512190b0jfclere<!--#include virtual="footer.html" -->