|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
|
|
Packit |
90a5c9 |
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
Packit |
90a5c9 |
This file is generated from xml source: DO NOT EDIT
|
|
Packit |
90a5c9 |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
Packit |
90a5c9 |
-->
|
|
Packit |
90a5c9 |
<title>Multi-Processing Modules (MPMs) - Apache HTTP Server Version 2.4</title>
|
|
Packit |
90a5c9 |
<link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
|
|
Packit |
90a5c9 |
<link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
|
|
Packit |
90a5c9 |
<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" />
|
|
Packit |
90a5c9 |
<script src="./style/scripts/prettify.min.js" type="text/javascript">
|
|
Packit |
90a5c9 |
</script>
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
<link href="./images/favicon.ico" rel="shortcut icon" /></head>
|
|
Packit |
90a5c9 |
<body id="manual-page">
|
|
Packit |
90a5c9 |
Modules | Directives | FAQ | Glossary | Sitemap
|
|
Packit |
90a5c9 |
Apache HTTP Server Version 2.4
|
|
Packit |
90a5c9 |
![](./images/feather.png)
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Apache > HTTP Server > Documentation > Version 2.4Multi-Processing Modules (MPMs)
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Available Languages: de |
|
|
Packit |
90a5c9 |
en |
|
|
Packit |
90a5c9 |
es |
|
|
Packit |
90a5c9 |
fr |
|
|
Packit |
90a5c9 |
ja |
|
|
Packit |
90a5c9 |
ko |
|
|
Packit |
90a5c9 |
tr |
|
|
Packit |
90a5c9 |
zh-cn
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
This document describes what a Multi-Processing Module is and
|
|
Packit |
90a5c9 |
how they are used by the Apache HTTP Server.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
MPM Defaults
|
|
Packit |
90a5c9 |
Building an MPM as a static module
|
|
Packit |
90a5c9 |
Building an MPM as a DSO module
|
|
Packit |
90a5c9 |
See also
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The Apache HTTP Server is designed to be a powerful and
|
|
Packit |
90a5c9 |
flexible web server that can work on a very wide variety of
|
|
Packit |
90a5c9 |
platforms in a range of different environments. Different
|
|
Packit |
90a5c9 |
platforms and different environments often require different
|
|
Packit |
90a5c9 |
features, or may have different ways of implementing the same
|
|
Packit |
90a5c9 |
feature most efficiently. Apache httpd has always accommodated a wide
|
|
Packit |
90a5c9 |
variety of environments through its modular design. This design
|
|
Packit |
90a5c9 |
allows the webmaster to choose which features will be included
|
|
Packit |
90a5c9 |
in the server by selecting which modules to load either at
|
|
Packit |
90a5c9 |
compile-time or at run-time.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Apache HTTP Server 2.0 extends this modular design to the most basic
|
|
Packit |
90a5c9 |
functions of a web server. The server ships with a selection of
|
|
Packit |
90a5c9 |
Multi-Processing Modules (MPMs) which are responsible for
|
|
Packit |
90a5c9 |
binding to network ports on the machine, accepting requests,
|
|
Packit |
90a5c9 |
and dispatching children to handle the requests.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Extending the modular design to this level of the server
|
|
Packit |
90a5c9 |
allows two important benefits:
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Apache httpd can more cleanly and efficiently support a wide
|
|
Packit |
90a5c9 |
variety of operating systems. In particular, the Windows
|
|
Packit |
90a5c9 |
version of the server is now much more efficient, since
|
|
Packit |
90a5c9 |
mpm_winnt can use native
|
|
Packit |
90a5c9 |
networking features in place of the POSIX layer used in
|
|
Packit |
90a5c9 |
Apache httpd 1.3. This benefit also extends to other operating
|
|
Packit |
90a5c9 |
systems that implement specialized MPMs.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The server can be better customized for the needs of the
|
|
Packit |
90a5c9 |
particular site. For example, sites that need a great deal of
|
|
Packit |
90a5c9 |
scalability can choose to use a threaded MPM like
|
|
Packit |
90a5c9 |
worker or event , while sites requiring
|
|
Packit |
90a5c9 |
stability or compatibility with older software can use a
|
|
Packit |
90a5c9 |
prefork .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
At the user level, MPMs appear much like other Apache httpd
|
|
Packit |
90a5c9 |
modules. The main difference is that one and only one MPM must
|
|
Packit |
90a5c9 |
be loaded into the server at any time. The list of available
|
|
Packit |
90a5c9 |
MPMs appears on the module index page.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The following table lists the default MPMs for various operating
|
|
Packit |
90a5c9 |
systems. This will be the MPM selected if you do not make another
|
|
Packit |
90a5c9 |
choice at compile-time.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
OS/2mpmt_os2
|
|
Packit |
90a5c9 |
Unixprefork , worker , or
|
|
Packit |
90a5c9 |
event , depending on platform capabilities
|
|
Packit |
90a5c9 |
Windowsmpm_winnt
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Here, 'Unix' is used to mean Unix-like operating systems, such as
|
|
Packit |
90a5c9 |
Linux, BSD, Solaris, Mac OS X, etc.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
In the case of Unix, the decision as to which MPM is installed is
|
|
Packit |
90a5c9 |
based on two questions:
|
|
Packit |
90a5c9 |
1. Does the system support threads?
|
|
Packit |
90a5c9 |
2. Does the system support thread-safe polling (Specifically, the
|
|
Packit |
90a5c9 |
kqueue and epoll functions)?
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
If the answer to both questions is 'yes', the default MPM is
|
|
Packit |
90a5c9 |
event .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
If The answer to #1 is 'yes', but the answer to #2 is 'no', the
|
|
Packit |
90a5c9 |
default will be worker .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
If the answer to both questions is 'no', then the default MPM will be
|
|
Packit |
90a5c9 |
prefork .
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
In practical terms, this means that the default will almost always be
|
|
Packit |
90a5c9 |
event , as all modern operating systems support these
|
|
Packit |
90a5c9 |
two features.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
MPMs can be built as static modules on all platforms. A single MPM
|
|
Packit |
90a5c9 |
is chosen at build time and linked into the server. The server must
|
|
Packit |
90a5c9 |
be rebuilt in order to change the MPM.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
To override the default MPM choice, use the
|
|
Packit |
90a5c9 |
--with-mpm=NAME option of the
|
|
Packit |
90a5c9 |
configure script. NAME is the name of the
|
|
Packit |
90a5c9 |
desired MPM.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Once the server has been compiled, it is possible to determine which MPM
|
|
Packit |
90a5c9 |
was chosen by using ./httpd -l . This command will list every
|
|
Packit |
90a5c9 |
module that is compiled into the server, including the MPM.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
On Unix and similar platforms, MPMs can be built as DSO modules and
|
|
Packit |
90a5c9 |
dynamically loaded into the server in the same manner as other DSO
|
|
Packit |
90a5c9 |
modules. Building MPMs as DSO modules allows the MPM to be changed by
|
|
Packit |
90a5c9 |
updating the LoadModule directive
|
|
Packit |
90a5c9 |
for the MPM instead of by rebuilding the server.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Attempting to LoadModule
|
|
Packit |
90a5c9 |
more than one MPM will result in a startup failure with the
|
|
Packit |
90a5c9 |
following error.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
AH00534: httpd: Configuration error: More than one MPM
|
|
Packit |
90a5c9 |
loaded.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
This feature is enabled using the
|
|
Packit |
90a5c9 |
--enable-mpms-shared option of the configure
|
|
Packit |
90a5c9 |
script.
|
|
Packit |
90a5c9 |
With argument all , all possible MPMs for the platform
|
|
Packit |
90a5c9 |
will be installed. Alternately, a list of MPMs can be specified as the
|
|
Packit |
90a5c9 |
argument.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
The default MPM, either selected automatically or specified with the
|
|
Packit |
90a5c9 |
--with-mpm option of the configure
|
|
Packit |
90a5c9 |
script, will be loaded in the generated server configuration file. Edit the
|
|
Packit |
90a5c9 |
LoadModule directive to select a
|
|
Packit |
90a5c9 |
different MPM.
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
|
|
Packit |
90a5c9 |
Available Languages: de |
|
|
Packit |
90a5c9 |
en |
|
|
Packit |
90a5c9 |
es |
|
|
Packit |
90a5c9 |
fr |
|
|
Packit |
90a5c9 |
ja |
|
|
Packit |
90a5c9 |
ko |
|
|
Packit |
90a5c9 |
tr |
|
|
Packit |
90a5c9 |
zh-cn
|
|
Packit |
90a5c9 |
Notice:This is not a Q&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 mailing lists.
|
|
Packit |
90a5c9 |
<script type="text/javascript">
|
|
Packit |
90a5c9 |
var comments_shortname = 'httpd';
|
|
Packit |
90a5c9 |
var comments_identifier = 'http://httpd.apache.org/docs/2.4/mpm.html';
|
|
Packit |
90a5c9 |
(function(w, d) {
|
|
Packit |
90a5c9 |
if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
|
|
Packit |
90a5c9 |
d.write('
|
|
Packit |
90a5c9 |
var s = d.createElement('script');
|
|
Packit |
90a5c9 |
s.type = 'text/javascript';
|
|
Packit |
90a5c9 |
s.async = true;
|
|
Packit |
90a5c9 |
s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
|
|
Packit |
90a5c9 |
(d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
|
|
Packit |
90a5c9 |
}
|
|
Packit |
90a5c9 |
else {
|
|
Packit |
90a5c9 |
d.write('
|
|
Packit |
90a5c9 |
}
|
|
Packit |
90a5c9 |
})(window, document);
|
|
Packit |
90a5c9 |
//--></script>
|
|
Packit |
90a5c9 |
Copyright 2018 The Apache Software Foundation. Licensed under the Apache License, Version 2.0.
|
|
Packit |
90a5c9 |
Modules | Directives | FAQ | Glossary | Sitemap <script type="text/javascript">
|
|
Packit |
90a5c9 |
if (typeof(prettyPrint) !== 'undefined') {
|
|
Packit |
90a5c9 |
prettyPrint();
|
|
Packit |
90a5c9 |
}
|
|
Packit |
90a5c9 |
//--></script>
|
|
Packit |
90a5c9 |
</body></html>
|