0

I am unable to find values of MPM Prefork directives like MaxRequestWorkers/MaxSpareThreads etc in my config file. Is there a way to list these values from command line?

-bash-4.2# httpd -v
Server version: Apache/2.4.23 (Amazon)

-bash-4.2# httpd -V
Server version: Apache/2.4.23 (Amazon)
Server built:   Jul 29 2016 21:42:17
Server's Module Magic Number: 20120211:61
Server loaded:  APR 1.5.1, APR-UTIL 1.4.1
Compiled using: APR 1.5.1, APR-UTIL 1.4.1
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/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="/var/run/httpd/httpd.pid"
 -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"

PS: I have posted it on SuperUser as well. I am not sure which one is the right place.

0
  1. you will never find MaxSpareThreads because prefork is not threaded, so it should be **MaxSpareServers**
  2. Not from the command line, you need to "cat" your main configuration file, or whereever your distro has placed them (httpd.conf or apache.conf or mpm.conf?)
  3. If you have mod_info you can "curl" your server for its information and parse/read the settings from it, that's the closest thing to get that info from command line you will probably find. There you will see a section called Module name: prefork.c and after some text something that says "Current Configuration:" which shows your actual mpm settings. (note: mod_info should not be publicaly available in your server to anyone that accesses it since it practically reveals your whole configuration).

Should you need further info about how prefork is/should be configured you can check it at the official docs about mpm prefork

Note: I would not recommend prefork anways, go for event and if it is because mod_php, ditch it in favour of php-fpm.

2
  • Even MaxSpareServers is nowhere to be found. Checked everything in conf/ conf.d/ conf.modules.d/. conf.modules.d has a file named 00-mpm.conf. Only uncommented line there is this : LoadModule mpm_prefork_module modules/mod_mpm_prefork.so – simplfuzz Jan 19 '17 at 14:52
  • no problem, add/set them yourself then, most directives have default values so if they are not specified you will get the default values, you can check them in the official docs I linked. – ezra-s Jan 20 '17 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.