Page tree
Skip to end of metadata
Go to start of metadata

Overview

Important:

This document only applies to systems that run EasyApache 4.

This document describes how EasyApache 4 uses Multi-Processing Modules (MPMs), and how to change them on your system. An Apache Multi-Processing Module 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.

  • An MPM allows 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 the worker or event MPMs. 

EasyApache 4 installs the prefork MPM by default. You can only install one MPM on your system at a time.

Note:

You may also use the MPM ITK module.


Available MPMs

EasyApache 4 provides the following MPMs:

MPMDescription
worker

The worker MPM causes Apache to fork into several processes so that a single crash does not kill the entire Apache process. Each forked process creates numerous threads, and a listener thread that listens for connections. This enables the system to serve multiple requests concurrently. For more information, read the Apache MPM worker documentation.

event

The event MPM serves a single HTTP request across multiple threads. However, the event MPM uses a dedication system and dedicates a thread to handle all live connections. The system allocates a request to the child threads only when it receives a request. This allows the threads instant availability after the request finishes.

We recommend this MPM for users that only make occasional concurrent requests, or when a user requires a long keep-alive timeout. For more information, read the Apache MPM event documentation.

prefork

The prefork MPM causes Apache to branch (fork) into additional processes before the system receives requests. When the server receives requests, it responds quickly to each request because an Apache process already exists to handle it. If a problem occurs with an individual process, the system can kill the process with no effect on the other Apache processes.

Because the prefork MPM is not threaded, each child process can only handle one request at a time. The system queues concurrent requests and the MPM waits to process each request until the system becomes available. Scaled child processes may result in the use of a large amount of system RAM. For more information, read the Apache MPM prefork documentation.

Note:

Only use the prefork MPM for non-thread-safe modules.

Guidelines to select an MPM

Remember:

  • If you do not select an MPM option, EasyApache installs the prefork MPM by default.
  • EasyApache 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 below.
  • cPanel & WHM only supports systems that offer threads and safe-thread polling.

Because each system possesses different requirements, use the following information to determine which MPM to choose 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.

The MPM ITK module

The mod_mpm_itk module is now 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.

Warnings:

  • 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

You can use the following methods to change your Apache MPM:

  • We strongly recommend that you change your Apache MPM in WHM's EasyApache 4 interface (WHM >> Home >> Software >> EasyApache 4). This method provides the easiest way to ensure that the system implements your changes correctly. 
  • To change your system's MPM on the command line in EasyApache 4, use the yum shell command. The yum shell command issues several commands in a single transaction.

    Warnings:

    • If you remove an MPM via the command line but do not use the yum shell command, the system will uninstall the ea-apache24 package. 
    • Do not remove the Apache stack completely.

How to replace the worker MPM with the event MPM

To replace the worker MPM with the event MPM, run the following commands:

yum shell
remove ea-apache24-mod_mpm_worker
install ea-apache24-mod_mpm_event
run

How to replace the worker MPM with the prefork MPM

To replace the worker MPM with the prefork MPM, run the following commands:

yum shell
remove ea-apache24-mod_mpm_worker
remove ea-apache24-mod_cgid
install ea-apache24-mod_mpm_prefork
install ea-apache24-mod_cgi
run

How to replace the event MPM with the prefork MPM

To replace the event MPM with the prefork MPM, run the following commands:

yum shell
remove ea-apache24-mod_mpm_event
remove ea-apache24-mod_cgid
install ea-apache24-mod_mpm_prefork
install ea-apache24-mod_cgi
run

Additional documentation