Appendix C. Multi-processing modules (MPMs)
Red Hat JBoss Core Services includes a variety of multi-processing modules (MPMs). You can use these MPMs to customize how the Apache HTTP Server responds to incoming requests.
C.1. MPMs overview
Multi-processing modules (MPMs) are available for both Red Hat Enterprise Linux and Microsoft Windows.
MPMs for Red Hat Enterprise Linux
prefork
-
The
prefork
MPM implements a non-threaded, pre-forking web server. A single control process is responsible for launching child processes, which listen for incoming connections and service them when they arrive. Each request is handled by a single process, ensuring that each request is isolated, and will not affect any other requests. worker
-
The
worker
MPM implements a hybrid multi-process, multi-threaded server. Each child process creates a fixed number of server threads, allowing the server to handle a large number of requests with fewer system resources. event
-
The
event
MPM is based off theworker
MPM, but allows additional requests to be served simultaneously by passing off some processing work to the listener threads, therefore freeing up the worker threads to serve new requests.
MPMs for Microsoft Windows
winnt
-
The
winnt
MPM is the only one available for Windows systems. It uses a single control process, which launches a single process used to create threads for incoming requests.
C.2. Switching the MPM
The server selects the MPM based on the LoadModule
directives in the JBCS_HOME/httpd/conf.modules.d/00-mpm.conf
file. You can select a specific MPM by removing the comment character (#
) from the LoadModule
directive for that MPM in the 00-mpm.conf
file.
By default, the prefork
MPM is selected. For example:
# prefork MPM: Implements a non-threaded, pre-forking web server # See: http://httpd.apache.org/docs/2.4/mod/prefork.html LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
Procedure
Edit the
JBCS_HOME/httpd/conf.modules.d/00-mpm.conf
to add a comment (#
) character to theLoadModule
directive for theprefork
MPM. For example:# prefork MPM: Implements a non-threaded, pre-forking web server # See: http://httpd.apache.org/docs/2.4/mod/prefork.html #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
In the same
00-mpm.conf
file, remove the comment (#
) character from theLoadModule
directive for the MPM that you want to switch to. These lines are located immediately below theprefork
MPM.For example, to load the
worker
MPM, remove the comment (#
) character from theLoadModule
directive for theworker
MPM:# worker MPM: Multi-Processing Module implementing a hybrid # multi-threaded multi-process web server # See: http://httpd.apache.org/docs/2.4/mod/worker.html LoadModule mpm_worker_module modules/mod_mpm_worker.so
To verify the MPM is configured correctly, enter the following command:
$ sbin/apachectl -V
This command displays the current MPM. For example:
Server MPM: worker