mpm.html revision e3ec3193b69b45923c14915fa3ee3bc1f0215baf
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
fa9e4066f08beec538e775443c5be79dd423fcabahrens BGCOLOR="#FFFFFF"
fa9e4066f08beec538e775443c5be79dd423fcabahrens TEXT="#000000"
fa9e4066f08beec538e775443c5be79dd423fcabahrens LINK="#0000FF"
fa9e4066f08beec538e775443c5be79dd423fcabahrens VLINK="#000080"
fa9e4066f08beec538e775443c5be79dd423fcabahrens ALINK="#FF0000"
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!--#include virtual="header.html" -->
fa9e4066f08beec538e775443c5be79dd423fcabahrens<h1 align="center">Apache Multi-Processing Modules</h1>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<p>The Apache HTTP Server is designed to be a powerful and flexible
99653d4ee642c6528e88224f12409a5f23060994eschrockweb server that can work on a very wide variety of platforms in a
fa9e4066f08beec538e775443c5be79dd423fcabahrensrange of different environments. Different platforms and different
3f9d6ad73e45c6823b409f93b0c8d4f62861d2d5Lin Lingenvironments often require different features, or may have different
8704186e373c9ed74daa395ff3f7fd745396df9eDan McDonaldways of implementing the same feature most efficiently. Apache has
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Sidenalways accommodated a wide variety of environments through its modular
fa9e4066f08beec538e775443c5be79dd423fcabahrensdesign. This design allows the webmaster to choose which features
fa9e4066f08beec538e775443c5be79dd423fcabahrenswill be included in the server by selecting which modules to load
fa9e4066f08beec538e775443c5be79dd423fcabahrenseither at compile-time or at run-time.</p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<p>Apache 2.0 extends this modular design to the most basic functions
fa9e4066f08beec538e775443c5be79dd423fcabahrensof a web server. The server ships with a selection of
fa9e4066f08beec538e775443c5be79dd423fcabahrensMulti-Processing Modules (MPMs) which are responsible for binding to
fa9e4066f08beec538e775443c5be79dd423fcabahrensnetwork ports on the machine, accepting requests, and dispatching
fa9e4066f08beec538e775443c5be79dd423fcabahrenschildren to handle the requests.</p>
95173954d2b811ceb583a9012c3b16e1d0dd6438ek<p>Extending the modular design to this level of the server
95173954d2b811ceb583a9012c3b16e1d0dd6438ekallows two important benefits:
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrock<li>Apache can more cleanly and efficiently support a wide variety of
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrockoperating systems. In particular, the Windows version of Apache is
5679c89fcd2facbb4334df8870d3d7a4d2b11673jvnow much more efficient, since <a
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrockhref="mod/mpm_winnt.html">mpm_winnt</a> can use native networking
ea8dc4b6d2251b437950c0056bc626b311c73c27eschrockfeatures in place of the POSIX layer used in Apache 1.3. This benefit
fa9e4066f08beec538e775443c5be79dd423fcabahrensalso extends to other operating systems that implement specialized
fa9e4066f08beec538e775443c5be79dd423fcabahrens<li>The server can be better customized for the needs of the
2f8aaab38e6371ad39ed90a1211ba8921acbb4d5eschrockparticular site. For example, sites that need a great deal of
2f8aaab38e6371ad39ed90a1211ba8921acbb4d5eschrockscalability can choose to use a threaded MPM like <a
2f8aaab38e6371ad39ed90a1211ba8921acbb4d5eschrockhref="mod/threaded.html">threaded</a>, while sites requiring
2f8aaab38e6371ad39ed90a1211ba8921acbb4d5eschrockstability or compatibility with older software can use a <a
2f8aaab38e6371ad39ed90a1211ba8921acbb4d5eschrockhref="mod/prefork.html">preforking MPM</a>. In addition, special
fa9e4066f08beec538e775443c5be79dd423fcabahrensfeatures like serving different hosts under different userids
2f8aaab38e6371ad39ed90a1211ba8921acbb4d5eschrock(<a href="mod/perchild.html">perchild</a>) can be provided.</li>
2f8aaab38e6371ad39ed90a1211ba8921acbb4d5eschrock<p>At the user level, MPMs appear much like other Apache modules.
2f8aaab38e6371ad39ed90a1211ba8921acbb4d5eschrockThe main difference is that one and only one MPM must be loaded
2f8aaab38e6371ad39ed90a1211ba8921acbb4d5eschrockinto the server at any time. The list of available MPMs
fa9e4066f08beec538e775443c5be79dd423fcabahrensappears on the <a href="mod/">module index page</a>.</p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<p>MPMs must be chosen during configuration, and compiled into the server.
fa9e4066f08beec538e775443c5be79dd423fcabahrensCompilers are capable of optimizing a lot of functions if threads are used,
fa9e4066f08beec538e775443c5be79dd423fcabahrensbut only if they know that threads are being used. Because some MPMs use
fa9e4066f08beec538e775443c5be79dd423fcabahrensthreads on Unix and others don't, Apache will always perform better if the
c5904d138f3bdf0762dbf452a43d5a5c387ea6a8eschrockMPM is chosen at configuration time and built into Apache.</p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<p>To actually choose the desired MPM, use the argument --with-mpm=
fa9e4066f08beec538e775443c5be79dd423fcabahrens<EM>NAME</EM> with the /configure script. <EM>NAME</EM> is the name of
fa9e4066f08beec538e775443c5be79dd423fcabahrensthe desired MPM.</p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<p>Once the server has been compiled, it is possible to determine which
fa9e4066f08beec538e775443c5be79dd423fcabahrensMPM was chosen by using <code>/httpd -l</code>. This command will list
fa9e4066f08beec538e775443c5be79dd423fcabahrensevery module that is compiled into the server, including the MPM.</p>
fa9e4066f08beec538e775443c5be79dd423fcabahrens<!--#include virtual="footer.html" -->