Multi-Processing Modules: MPMs
Last modified: September 5, 2024
Overview
An Apache Multi-Processing Module (MPM) provides a modular approach to web server functions. The MPM that you select determines how Apache binds to network ports, accepts HTTP requests, and dispatches child processes to handle the HTTP requests.
- MPMs allow the user to choose which features, characteristics, or modules they want to include with a server request. The modules then load these requests at compile or run time.
- Due to the differences between each MPM, some MPMs work better on specific systems than others. For example, we recommend that you use the
prefork
MPM if you use older software that requires stability and compatibility. For websites that require more diversity and scalability, we recommend that you use theworker
orevent
MPMs.
EasyApache 4 installs the prefork MPM by default. You can only install one MPM on your system at a time.
Available MPMs
EasyApache 4 provides the following MPMs:
MPM | Description |
---|---|
worker |
The worker MPM causes Apache to fork multiple processes to ensure that a single crash does not terminate the entire Apache service. Each forked process creates multiple threads, and a listener thread that listens for incoming connections. This configuration enables the server to handle multiple requests concurrently. For more information, read Apache’s MPM worker documentation. |
event |
The event MPM processes a single HTTP request across multiple threads. It dedicates threads to handle active connections and uses an event-driven mechanism to manage keep-alive requests efficiently. This behavior ensures that threads are instantly available after a request is completed. We recommend the event MPM for users with occasional concurrent requests, or those that require long keep-alive timeouts. For more information, read Apache’s MPM event documentation. |
prefork |
The prefork MPM forks additional processes in advance of incoming requests. When Apache receives a request, the server can respond promptly because an Apache process is already available to handle it. If a problem occurs with an individual process, Apache can terminate that process without affecting the others. Since the prefork MPM is not threaded, each child process can handle only one request at a time. The system queues concurrent requests and the MPM processes each request as resources become available. This configuration can consume a large amount of system RAM due to multiple child processes. For more information, read Apache’s MPM prefork documentation.
|
Guidelines to select an MPM
Because each system possesses different requirements, use the following information to determine the proper MPM for your system.
- If your system requires threads and allows for safe thread-polling, use the event MPM.
- If your system requires threads, but does not allow for safe thread-polling, use the worker MPM.
- If your system does not require threads and does not allow for safe thread-polling, use the prefork MPM.
- If you do not select an MPM option, EasyApache installs the
prefork
MPM by default. - EasyApache 4 only builds one MPM into your Apache configuration.
- The MPM ITK module is not an MPM. You must use the
prefork
MPM in order to use the MPM ITK Apache module. For more information, read the The MPM ITK module section. - cPanel & WHM only supports systems that offer threads and safe-thread polling.
The MPM ITK module
The mod_mpm_itk
module now exists only as an Apache module. It does not function as a stand-alone MPM. You can install this module with WHM’s EasyApache 4 interface (WHM » Home » Software » EasyApache 4) or via yum. For more information, read our Apache Module: MPM ITK documentation.
- Only systems that run Apache 2.4 can install the MPM ITK Apache module.
- You must install the
prefork
MPM in order to use the MPM ITK module.
Change your Apache MPM
To change your Apache MPM, use the Apache MPM section of WHM’s EasyApache 4 interface (WHM » Home » Software » EasyApache 4).