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 Copy linkLink copied to clipboard!
Multi-processing modules (MPMs) are available for both Red Hat Enterprise Linux and Microsoft Windows.
MPMs for Red Hat Enterprise Linux
prefork-
The
preforkMPM 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
workerMPM 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
eventMPM is based off theworkerMPM, 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
winntMPM 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 Copy linkLink copied to clipboard!
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
# 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.confto add a comment (#) character to theLoadModuledirective for thepreforkMPM. 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
# 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.soCopy to Clipboard Copied! Toggle word wrap Toggle overflow In the same
00-mpm.conffile, remove the comment (#) character from theLoadModuledirective for the MPM that you want to switch to. These lines are located immediately below thepreforkMPM.For example, to load the
workerMPM, remove the comment (#) character from theLoadModuledirective for theworkerMPM: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
# 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.soCopy to Clipboard Copied! Toggle word wrap Toggle overflow To verify the MPM is configured correctly, enter the following command:
sbin/apachectl -V
$ sbin/apachectl -VCopy to Clipboard Copied! Toggle word wrap Toggle overflow This command displays the current MPM. For example:
Server MPM: worker
Server MPM: workerCopy to Clipboard Copied! Toggle word wrap Toggle overflow