Appendix F. 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.
MPMs are mutually exclusive. You may only enable and use one MPM at any specific time.
F.1. MPMs overview Copy linkLink copied to clipboard!
Multi-processing modules (MPMs) are available for both Red Hat Enterprise Linux (RHEL) and Windows Server. On RHEL, the default MPM varies depending on the operating system version.
MPMs for RHEL
preforkThe
preforkMPM implements a non-threaded, pre-forking web server. ThepreforkMPM uses a single control process, which launches child processes that listen for and service incoming connections. A single process handles a specific request, which ensures that each request is isolated and does not affect any other requests.NoteThe
preforkMPM is the default MPM on RHEL 7.worker-
The
workerMPM implements a hybrid multi-process, multi-threaded server. Each child process creates a fixed number of server threads, which allows the server to handle a large number of requests with fewer system resources. eventThe
eventMPM is based on theworkerMPM. TheeventMPM allows additional requests to be served simultaneously by delegating some processing work to the listener threads, which frees up the worker threads to serve new requests.NoteThe
eventMPM is the default MPM on RHEL versions 8 and 9.
MPMs for Microsoft Windows
winnt-
The
winntMPM is the only MPM that is available for Windows systems. ThewinntMPM uses a single control process, which launches another process that creates threads for incoming requests.
F.2. Switching the MPM Copy linkLink copied to clipboard!
The server selects the MPM based on the LoadModule directives in the 00-mpm.conf file on the Apache HTTP Server host. You can select a specific MPM by removing the comment character (#) from the LoadModule directive for that MPM in the 00-mpm.conf file.
Depending on the Apache HTTP Server distribution that you are using, the location of the 00-mpm.conf file varies:
-
If you are using the JBCS Apache HTTP Server, the
00-mpm.conffile is in theJBCS_HOME/httpd/conf.modules.ddirectory. -
If you are using the RHEL Apache HTTP Server, the
00-mpm.conffile is in the/etc/httpd/conf.modules.ddirectory.
Depending on the operating system version that you are using, consider the following guidelines:
On RHEL versions 8 and 9, the
eventMPM is selected by default. For example:event MPM: A variant of the worker MPM with the goal of consuming threads only for connections with active processing See: http://httpd.apache.org/docs/2.4/mod/event.html
# event MPM: A variant of the worker MPM with the goal of consuming # threads only for connections with active processing # See: http://httpd.apache.org/docs/2.4/mod/event.html # LoadModule mpm_event_module modules/mod_mpm_event.soCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
eventMPM is multi-threaded and designed to provide optimized performance. If you are using RHEL version 8 or 9, switching to another MPM such aspreforkmight lead to performance issues.On RHEL 7, the
preforkMPM is selected by default. For example:prefork MPM: Implements a non-threaded, pre-forking web server See: http://httpd.apache.org/docs/2.4/mod/prefork.html
# 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 If you are using RHEL 7, consider switching to another MPM such as
workeroreventto avoid possible performance issues.
For illustrative purposes, the following procedure describes how to switch from the prefork MPM to the worker MPM.
Procedure
Go to the directory that contains the
00-mpm.conffile:-
If you are using the JBCS Apache HTTP Server, go to the
JBCS_HOME/httpd/conf.modules.ddirectory. -
If you are using the RHEL Apache HTTP Server, go to the
/etc/httpd/conf.modules.ddirectory.
-
If you are using the JBCS Apache HTTP Server, go to the
Edit the
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
# 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
# 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
Verification
To verify that the MPM is configured correctly, enter the following command:
sbin/apachectl -V
$ sbin/apachectl -VCopy to Clipboard Copied! Toggle word wrap Toggle overflow The preceding command displays the current MPM.
For example:
Server MPM: worker
Server MPM: workerCopy to Clipboard Copied! Toggle word wrap Toggle overflow
F.3. MPM performance settings Copy linkLink copied to clipboard!
For each type of MPM, you can configure various settings to optimize the MPM performance.
Types of MPM performance settings
MPM performance settings specify the following types of criteria:
- Initial number of server processes to create at startup
- Minimum and maximum number of idle threads or server processes
- Maximum number of threads or server processes available to handle requests
- Maximum number of requests an individual server process can handle
-
Number of threads each server process creates (
workerandeventMPMs only) -
Upper limit for the maximum number of server processes that can start during the lifetime of the server (
preforkMPM only)
Configuration file for MPM performance settings
In JBCS 2.4.51 or later, you can configure MPM performance settings in the mpm.conf file. Depending on the Apache HTTP Server distribution that you are using, the location of the mpm.conf file varies:
-
If you are using the JBCS Apache HTTP Server, the
mpm.conffile is in theJBCS_HOME/httpd/conf.ddirectory. -
If you are using the RHEL Apache HTTP Server, the
mpm.conffile is in the/etc/httpd/conf.ddirectory.
In JBCS 2.4.37 or earlier releases, the conf.modules.d/00-mpm.conf file contained the MPM performance settings. From JBCS 2.4.57 onward, the conf.d/mpm.conf file contains these settings.
If you are upgrading from JBCS 2.4.37 or earlier, ensure that you configure the conf.d/mpm.conf file for your upgraded 2.4.57 installation to match any customized settings that you previously configured in conf.modules.d/00-mpm.conf. Otherwise, your upgraded JBCS 2.4.57 installation automatically uses the default settings in the conf.d/mpm.conf file, which might lead to unexpected performance issues.
For more information about the available performance settings and associated default values, see the conf.d/mpm.conf file in your Apache HTTP Server installation.