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.
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