]> granicus.if.org Git - apache/blob - docs/manual/mpm.html.en
Rebuild.
[apache] / docs / manual / mpm.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
4 <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
5 <!--
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7               This file is generated from xml source: DO NOT EDIT
8         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9       -->
10 <title>Multi-Processing Modules (MPMs) - Apache HTTP Server Version 2.5</title>
11 <link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
12 <link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
13 <link href="./style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="./style/css/prettify.css" />
14 <script src="./style/scripts/prettify.min.js" type="text/javascript">
15 </script>
16
17 <link href="./images/favicon.ico" rel="shortcut icon" /></head>
18 <body id="manual-page"><div id="page-header">
19 <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p>
20 <p class="apache">Apache HTTP Server Version 2.5</p>
21 <img alt="" src="./images/feather.png" /></div>
22 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="./images/left.gif" /></a></div>
23 <div id="path">
24 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="./">Version 2.5</a></div><div id="page-content"><div id="preamble"><h1>Multi-Processing Modules (MPMs)</h1>
25 <div class="toplang">
26 <p><span>Available Languages: </span><a href="./de/mpm.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
27 <a href="./en/mpm.html" title="English">&nbsp;en&nbsp;</a> |
28 <a href="./es/mpm.html" hreflang="es" rel="alternate" title="Español">&nbsp;es&nbsp;</a> |
29 <a href="./fr/mpm.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
30 <a href="./ja/mpm.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
31 <a href="./ko/mpm.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
32 <a href="./tr/mpm.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a> |
33 <a href="./zh-cn/mpm.html" hreflang="zh-cn" rel="alternate" title="Simplified Chinese">&nbsp;zh-cn&nbsp;</a></p>
34 </div>
35
36 <p>This document describes what a Multi-Processing Module is and
37 how they are used by the Apache HTTP Server.</p>
38 </div>
39 <div id="quickview"><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#introduction">Introduction</a></li>
40 <li><img alt="" src="./images/down.gif" /> <a href="#defaults">MPM Defaults</a></li>
41 <li><img alt="" src="./images/down.gif" /> <a href="#static">Building an MPM as a static module</a></li>
42 <li><img alt="" src="./images/down.gif" /> <a href="#dynamic">Building an MPM as a DSO module</a></li>
43 </ul><h3>See also</h3><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
44 <div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
45 <div class="section">
46 <h2><a name="introduction" id="introduction">Introduction</a></h2>
47
48     <p>The Apache HTTP Server is designed to be a powerful and
49     flexible web server that can work on a very wide variety of
50     platforms in a range of different environments. Different
51     platforms and different environments often require different
52     features, or may have different ways of implementing the same
53     feature most efficiently. Apache httpd has always accommodated a wide
54     variety of environments through its modular design. This design
55     allows the webmaster to choose which features will be included
56     in the server by selecting which modules to load either at
57     compile-time or at run-time.</p>
58
59     <p>Apache HTTP Server 2.0 extends this modular design to the most basic
60     functions of a web server. The server ships with a selection of
61     Multi-Processing Modules (MPMs) which are responsible for
62     binding to network ports on the machine, accepting requests,
63     and dispatching children to handle the requests.</p>
64
65     <p>Extending the modular design to this level of the server
66     allows two important benefits:</p>
67
68     <ul>
69       <li>Apache httpd can more cleanly and efficiently support a wide
70       variety of operating systems. In particular, the Windows
71       version of the server is now much more efficient, since
72       <code class="module"><a href="./mod/mpm_winnt.html">mpm_winnt</a></code> can use native
73       networking features in place of the POSIX layer used in
74       Apache httpd 1.3. This benefit also extends to other operating
75       systems that implement specialized MPMs.</li>
76
77       <li>The server can be better customized for the needs of the
78       particular site. For example, sites that need a great deal of
79       scalability can choose to use a threaded MPM like
80       <code class="module"><a href="./mod/worker.html">worker</a></code> or <code class="module"><a href="./mod/event.html">event</a></code>, while sites requiring
81       stability or compatibility with older software can use a
82       <code class="module"><a href="./mod/prefork.html">prefork</a></code>.</li>
83     </ul>
84
85     <p>At the user level, MPMs appear much like other Apache httpd
86     modules. The main difference is that one and only one MPM must
87     be loaded into the server at any time. The list of available
88     MPMs appears on the <a href="mod/">module index page</a>.</p>
89
90 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
91 <div class="section">
92 <h2><a name="defaults" id="defaults">MPM Defaults</a></h2>
93
94 <p>The following table lists the default MPMs for various operating
95 systems.  This will be the MPM selected if you do not make another
96 choice at compile-time.</p>
97
98 <table class="bordered"><tr><td>Netware</td><td><code class="module"><a href="./mod/mpm_netware.html">mpm_netware</a></code></td></tr>
99 <tr class="odd"><td>OS/2</td><td><code class="module"><a href="./mod/mpmt_os2.html">mpmt_os2</a></code></td></tr>
100 <tr><td>Unix</td><td><code class="module"><a href="./mod/prefork.html">prefork</a></code>, <code class="module"><a href="./mod/worker.html">worker</a></code>, or
101     <code class="module"><a href="./mod/event.html">event</a></code>, depending on platform capabilities</td></tr>
102 <tr class="odd"><td>Windows</td><td><code class="module"><a href="./mod/mpm_winnt.html">mpm_winnt</a></code></td></tr>
103 </table>
104
105 <div class="note"><p>Here, 'Unix' is used to mean Unix-like operating systems, such as
106 Linux, BSD, Solaris, Mac OS X, etc.</p></div>
107
108 <p>In the case of Unix, the decision as to which MPM is installed is
109 based on two questions:</p>
110 <p>1. Does the system support threads?</p>
111 <p>2. Does the system support thread-safe polling (Specifically, the
112 kqueue and epoll functions)?</p>
113
114 <p>If the answer to both questions is 'yes', the default MPM is
115 <code class="module"><a href="./mod/event.html">event</a></code>.</p>
116
117 <p>If The answer to #1 is 'yes', but the answer to #2 is 'no', the
118 default will be <code class="module"><a href="./mod/worker.html">worker</a></code>.</p>
119
120 <p>If the answer to both questions is 'no', then the default MPM will be
121 <code class="module"><a href="./mod/prefork.html">prefork</a></code>.</p>
122
123 <p>In practical terms, this means that the default will almost always be
124 <code class="module"><a href="./mod/event.html">event</a></code>, as all modern operating systems support these
125 two features.</p>
126
127 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
128 <div class="section">
129 <h2><a name="static" id="static">Building an MPM as a static module</a></h2>
130
131     <p>MPMs can be built as static modules on all platforms.  A single MPM
132     is chosen at build time and linked into the server.  The server must
133     be rebuilt in order to change the MPM.</p>
134
135     <p>To override the default MPM choice, use the
136     <code>--with-mpm=<em>NAME</em></code> option of the
137     <code class="program"><a href="./programs/configure.html">configure</a></code> script. <em>NAME</em> is the name of the
138     desired MPM.</p>
139
140     <p>Once the server has been compiled, it is possible to determine which MPM
141     was chosen by using <code>./httpd -l</code>. This command will list every
142     module that is compiled into the server, including the MPM.</p>
143
144 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
145 <div class="section">
146 <h2><a name="dynamic" id="dynamic">Building an MPM as a DSO module</a></h2>
147
148     <p>On Unix and similar platforms, MPMs can be built as DSO modules and
149     dynamically loaded into the server in the same manner as other DSO
150     modules.  Building MPMs as DSO modules allows the MPM to be changed by
151     updating the <code class="directive"><a href="./mod/mod_so.html#loadmodule">LoadModule</a></code> directive
152     for the MPM instead of by rebuilding the server.</p>
153
154     <pre class="prettyprint lang-config">LoadModule mpm_prefork_module modules/mod_mpm_prefork.so</pre>
155
156
157     <p>Attempting to <code class="directive"><a href="./mod/mod_so.html#loadmodule">LoadModule</a></code>
158     more than one MPM will result in a startup failure with the
159     following error.</p>
160
161     <div class="example"><p><code>AH00534: httpd: Configuration error: More than one MPM
162     loaded.</code></p></div>
163
164     <p>This feature is enabled using the
165     <code>--enable-mpms-shared</code> option of the <code class="program"><a href="./programs/configure.html">configure</a></code>
166     script.
167     With argument <code><em>all</em></code>, all possible MPMs for the platform
168     will be installed.  Alternately, a list of MPMs can be specified as the
169     argument.</p>
170
171     <p>The default MPM, either selected automatically or specified with the
172     <code>--with-mpm</code> option of the <code class="program"><a href="./programs/configure.html">configure</a></code>
173     script, will be loaded in the generated server configuration file.  Edit the
174     <code class="directive"><a href="./mod/mod_so.html#loadmodule">LoadModule</a></code> directive to select a
175     different MPM.</p>
176
177 </div></div>
178 <div class="bottomlang">
179 <p><span>Available Languages: </span><a href="./de/mpm.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
180 <a href="./en/mpm.html" title="English">&nbsp;en&nbsp;</a> |
181 <a href="./es/mpm.html" hreflang="es" rel="alternate" title="Español">&nbsp;es&nbsp;</a> |
182 <a href="./fr/mpm.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
183 <a href="./ja/mpm.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
184 <a href="./ko/mpm.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
185 <a href="./tr/mpm.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a> |
186 <a href="./zh-cn/mpm.html" hreflang="zh-cn" rel="alternate" title="Simplified Chinese">&nbsp;zh-cn&nbsp;</a></p>
187 </div><div class="top"><a href="#page-header"><img src="./images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
188 <script type="text/javascript"><!--//--><![CDATA[//><!--
189 var comments_shortname = 'httpd';
190 var comments_identifier = 'http://httpd.apache.org/docs/trunk/mpm.html';
191 (function(w, d) {
192     if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
193         d.write('<div id="comments_thread"><\/div>');
194         var s = d.createElement('script');
195         s.type = 'text/javascript';
196         s.async = true;
197         s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
198         (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
199     }
200     else {
201         d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
202     }
203 })(window, document);
204 //--><!]]></script></div><div id="footer">
205 <p class="apache">Copyright 2016 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
206 <p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
207 if (typeof(prettyPrint) !== 'undefined') {
208     prettyPrint();
209 }
210 //--><!]]></script>
211 </body></html>