MPM or Multi Processing Module provides portable multiprocessing to Apache HTTP Server.
Apache HTTP Server is designed to work on a wide variety of platforms in a different range of environments. Different platforms and environments require different features, or may have different ways of implementing the same feature most efficiently.
Apache HTTP Server has a modular design, which allows the webmaster to choose which features will be included in the server by selecting modules to load either at compile-time or at run-time. This modular design is extended to the most basic functions of a web server. The server ships with a selection of MPMs which are responsible for binding to network ports on the machine, accepting requests, and dispatching children to handle the requests. At the user level, MPMs appear much like other Apache HTTP Server modules. The main difference is that one and only one MPM must be loaded into the server at any time.
MPMs allows two important benefits.
• Support more cleanly and efficiently a wide variety of Operating systems.
• Better customization of Server for the needs of a particular site.
http://httpd.apache.org/docs/2.4/mpm.html
MPMs provided by Apache HTTP Server are.
1) netware
2) mpmt_os2
3) winnt
4) prefork
5) worker
6) event
1) netware
Implements an exclusively threaded web server, optimized for Novell NetWare version of Apache HTTP Server.
http://httpd.apache.org/docs/2.4/mod/mpm_netware.html
2) mpmt_os2
Implements a hybrid multi-threaded and multi-process web server, for OS/2 version of Apache HTTP Server.
http://httpd.apache.org/docs/2.4/mod/mpmt_os2.html
3) winnt
Implements a threaded webserver, optimized for Windows NT version of Apache HTTP Server.
http://httpd.apache.org/docs/2.4/mod/mpm_winnt.html
4) prefork
Implements a non-threaded and pre-forking web server, for Unix version of Apache HTTP Server.
It is appropriate for websites requiring stability or compatibility with older software. It works well with servers that avoid threading, for compatibility with non-thread-safe libraries. It is also the best MPM for isolating each request, so that a problem with a single request will not affect any other. This MPM is very self-regulating, so it is rarely necessary to adjust its configuration directives.
http://httpd.apache.org/docs/2.4/mod/prefork.html
5) worker
Implements a hybrid multi-threaded multi-process web server, for Unix version of Apache HTTP Server.
It is appropriate for websites requiring great deal of scalability. By using threads to serve requests, it is able to serve a large number of requests with fewer system resources than a process-based server. However, it retains much of the stability of a process-based server by keeping multiple processes available, each with many threads.
http://httpd.apache.org/docs/2.4/mod/worker.html
6) event
Implements a hybrid multi-threaded multi-process web server, for Unix version of Apache HTTP Server.
This MPM is a variant of worker MPM. It is designed with the goal of consuming threads only for connections with active processing. It allow more requests to be served simultaneously by passing off some processing work to supporting threads, freeing up the main threads to work on new requests.
http://httpd.apache.org/docs/2.4/mod/event.html
MPMs can be built as DSOs for dynamic loading or statically linked with the server. A specific MPM can be chosen during compile time using any of the following options.
SYNTAX: --with-mpm=MPM
This option chooses the default MPM for our server. If MPMs are built as DSO modules using --enable-mpms-shared
option, this directive selects the MPM which will be loaded in the default configuration file. Otherwise, this directive selects the only available MPM, which will be statically linked into the server. If this option is omitted, the default MPM for our operating system will be used.
SYNTAX: --enable-mpms-shared=MPM-LIST
This option builds a list of MPMs as DSOs. One of these modules will be loaded dynamically using the LoadModule directive. MPM-LIST is a space-separated list of MPM names enclosed by quotation marks. For example, --enable-mpms-shared='prefork worker'
.
Additionally we can use the special keyword all, which will select all MPMs which support dynamic loading on the current platform and build them as DSO modules. For example, --enable-mpms-shared=all
.
If we do not make another choice at compile-time, the default MPMs for the corresponding Platform/OS will be selected. In the case of Unix like systems, the decision as to which MPM is installed is based on two questions.
1. Does the system support threads?
2. Does the system support thread-safe polling (Specifically, the kqueue and epoll functions)?
If,
1=Yes & 2=Yes => MPM is event
1=Yes & 2=No => MPM is worker
1=No & 2=No => MPM is prefork
In practical terms, this means that the default will almost always be event, as all modern operating systems support these two features.
You may go back to the following section.
Installing Apache HTTP Server