Ben's Pro Tips

Tech Tips Made Easy

February 19, 2014 Apache Tips, Linux Server Tips apache2, apache2.conf, apachectl, config file, httpd.conf, module, mpm, performance, prefork, tuning, web server

How to tell if Apache is running MPM, Prefork, or Worker module

When configuring Apache for performance, you’ll almost definitely find a need to alter the default MaxClients, StartServers, MinSpareServers, etc settings. Pop open your apache2.conf (or httpd.conf) and … wait a sec, which one is it?

The default setting here can vary by system, fortunately it’s easy to find.  Simply run:

apachectl -V

The output will be something like the following:

Server version: Apache/2.4.7 (Ubuntu)
Server built: Feb 13 2014 12:12:08
Server's Module Magic Number: 20120211:27
Server loaded: APR 1.5.1-dev, APR-UTIL 1.5.3
Compiled using: APR 1.5.1-dev, APR-UTIL 1.5.2
Architecture: 32-bit
Server MPM: prefork
 threaded: no
 forked: yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/etc/apache2"
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="mime.types"
 -D SERVER_CONFIG_FILE="apache2.conf"

The module will be listed in the line “Server MPM” (we see it’s prefork on mine, bolded above). Might be a good idea to note it in a comment in the conf file itself so you’ll remember next time.

Leave a comment

Time limit is exhausted. Please reload the CAPTCHA.