Improving scaling with the Worker MPM
Apache2 offers a variety of Multi-Processing Modules (MPM) for defining how the daemon will handle scaling. The default is typically prefork, which is a simple MPM which uses separate processes for handling each request. Scaling can be improved by using the Worker MPM or the newer Event MPM, which utilize threading in addition to processes in order to improve performance.
How to do it…
Configuring the worker MPM on Ubuntu 14.04.
Ubuntu 14.04 uses the multi-threaded Event MPM by default, but it may be disabled automatically if any non-threadsafe modules such as mod_php
are enabled.
To determine which MPM is in use, execute a2query –M
in order to determine what is configured.
You may then swap out the existing MPM with:
a2dismod mpm_$(a2query –M) a2enmod mpm_worker service apache2 restart
Note
Note:
That the preceding action will fail if you have any non-thread safe modules enabled.
Configuring the Worker MPM on CentOS 7
CentOS 7 uses the prefork MPM by default...