prefork vs apache的工作模块,正在使用什么?

时间:2013-08-01 16:06:10

标签: apache worker preforking

无法确定我的apache正在使用哪个MPM,任何人都可以根据以下输出判断吗? 我的猜测是Prefork正在被使用?

[root @ rp1a~] #cat / etc / sysconfig / httpd

#HTTPD=/usr/sbin/httpd.worker

#OPTIONS=

#HTTPD_LANG=C
ulimit -n 65000
OPTIONS="-D SetCacheHeaders -D Gzip -D front"

[root @ rp1a~] #tail /etc/httpd/conf.d/rp-base.conf

<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000
</IfModule>

[root @ rp1a~] #apachectl -V

Server version: Apache/2.2.3
Server built:   Jun 13 2013 10:45:37
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"

[root @ rp1a~]#/ usr / sbin / httpd -V

Server version: Apache/2.2.3
Server built:   Jun 13 2013 10:45:37
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"

[root @ rp1a~] #apachectl -l <​​/ p>

Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

[root @ rp1a~] #httpd -l <​​/ p>

Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

[root @ rp1a~]#httpd.worker -l <​​/ p>

Compiled in modules:
  core.c
  worker.c
  http_core.c
  mod_so.c

[root @ rp1a~] #ps -C httpd.worker -F

UID        PID  PPID  C    SZ   RSS PSR STIME TTY          TIME CMD

[root @ rp1a~] #ps -C httpd -F |头

UID        PID  PPID  C    SZ   RSS PSR STIME TTY          TIME CMD
root      3947     1  0 63439 12092   0 Jul29 ?        00:00:12 /usr/sbin/httpd -D SetCacheHeaders -D Gzip -D front
apache   16411  3947  0 64231  8632   1 13:28 ?        00:00:01 /usr/sbin/httpd -D SetCacheHeaders -D Gzip -D front
apache   16501  3947  0 64231  9372   1 13:32 ?        00:00:01 /usr/sbin/httpd -D SetCacheHeaders -D Gzip -D front
apache   16662  3947  0 64149  8452   1 13:40 ?        00:00:01 /usr/sbin/httpd -D SetCacheHeaders -D Gzip -D front
apache   16807  3947  0 64199  8688   1 13:50 ?        00:00:01 /usr/sbin/httpd -D SetCacheHeaders -D Gzip -D front
apache   16814  3947  0 64147  8452   1 13:51 ?        00:00:01 /usr/sbin/httpd -D SetCacheHeaders -D Gzip -D front
apache   16836  3947  0 64199  8612   1 13:51 ?        00:00:01 /usr/sbin/httpd -D SetCacheHeaders -D Gzip -D front
apache   16876  3947  0 64231  9204   1 13:51 ?        00:00:01 /usr/sbin/httpd -D SetCacheHeaders -D Gzip -D front
apache   16935  3947  0 64139  8452   1 13:54 ?        00:00:01 /usr/sbin/httpd -D SetCacheHeaders -D Gzip -D front

1 个答案:

答案 0 :(得分:1)

服务器MPM:Prefork

所以,是的,prefork似乎被使用了。但是为了确保您正在查看正确的二进制文件,请尝试使用/ usr / sbin / httpd -V。