Page 1 of 1

which Server MPM of Apache is better, prefork or worker ?

Posted: Thu Apr 27, 2017 8:56 am
by baijianpeng
I came across an article about Server MPM of Apache here:

http://m.fx114.net/qa-1-243627.aspx

According to that article, Worker mode is better than Prefork mode for Apache.

However, the Apache installed by VestaCP uses "prefork" by default. You can confirm this by run following command on SSH terminal:

Code: Select all

root@:~# apache2ctl -V
Server version: Apache/2.4.18 (Ubuntu)
Server built:   2016-07-14T12:32:26
Server's Module Magic Number: 20120211:52
Server loaded:  APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture:   64-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"
I am not a Linux pro, so I want to discuss this topic here, hope someone will clarify this choice.

If you concluded that "worker" is better, then, hope VestaCP team will change it to Worker in next release, and, teach me how to safely switch to Worker mode now.

Thank you.

Re: which Server MPM of Apache is better, prefork or worker ?

Posted: Tue Mar 05, 2019 12:01 pm
by ChaosHead
Event is better