Topic: Apache 2.2 MPM Worker instead of Prefork

How do we get Worker MPM working with your Apache 2.2 builds (we use mod_fcgid for PHP)? On first attempt Apache failed to restart as php-zts needed to be installed (a requirement of Worker MPM). We did so (from your repo) and now Apache restarts fine.

To get Worker operational, based on docs online, it should have been as easy as uncommenting the following line from /etc/sysconfig/httpd:

   HTTPD=/usr/sbin/httpd.worker

And then simply restarting Apache.

We've done that and still get the following:

# httpd -V
Server version: Apache/2.2.3
Server built:   Aug 30 2010 12:28:40
Server's Module Magic Number: 20051115:3
Server loaded:  APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-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=128
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="run/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"


As you can see, it still says we're using Prefork. Is Worker just not part of your build? Can it be added?

We've been researching the topic, and we should performance benefits both out of our PHP on mod_fcgid platform as well as a significant reduction in memory consumption (33% on average) on Ruby with Rails when using Ruby Enterprise w/ Phusion Passenger.

TIA.

Re: Apache 2.2 MPM Worker instead of Prefork

Try

/usr/sbin/httpd.worker -V

If you have change /etc/sysconfig/httpd, the service will be launch using this alternative binary.

You should rather use the information provided by /server-info and /server-status (must be enabled in conf)

Remi.

Desktop: Fedora 33 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 32 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

3 (edited by rhopek 2011-01-13 08:45:45)

Re: Apache 2.2 MPM Worker instead of Prefork

Thanks Remi, that helped. But oddly, running that command shows:

---
Architecture:   64-bit
Server MPM:     Worker
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/worker"
-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=128
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
---



But calling server-info shows:

---
Timeouts: connection: 120    keep-alive: 120
MPM Name: Worker
MPM Information: Max Daemons: 1 Threaded: yes Forked: yes
Server Architecture: 64-bit
Server Root: /etc/httpd
Config File: /etc/httpd/conf/httpd.conf
Server Built With:
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
---


Note how server-info still shows prefork for the directory. We're not sure if that is why we are still having so many PHP issues or not.

Re: Apache 2.2 MPM Worker instead of Prefork

rhopek, did you manage to fix your problem?  I am having similar issues.

Regards,
Tom