2017-10-10 109 views
0

我必須更改事件mpm默認配置以解決錯誤(記分牌已滿,而不是在MaxRequestWorkers.Increase,ServerLimit)但是我無法看到任何影響後對httpd.conf文件進行了更改。apache 2.4.4 mpm事件配置沒有得到應用

雖然我檢查了httpd進程,但它顯示3臺服務器正在運行25個線程。請在下面找到

[[email protected] ~]$ ps -ef|grep httpd 
root  67465  1 0 22:00 ?  00:00:00 /usr/sbin/httpd 
tomcat 67467 67465 0 22:00 ?  00:00:00 /usr/sbin/httpd 
tomcat 67468 67465 0 22:00 ?  00:00:00 /usr/sbin/httpd 
tomcat 67470 67465 0 22:00 ?  00:00:00 /usr/sbin/httpd 
sdlansi 68271 65078 0 22:21 pts/0 00:00:00 grep --color=auto httpd 
[[email protected] ~]$ ps -eLo pid,lwp,nlwp,ruser,pcpu,stime,etime,args|grep 67467 
67467 67467 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67471 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67472 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67479 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67480 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67481 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67482 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67483 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67484 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67485 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67486 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67487 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67489 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67491 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67493 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67496 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67498 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67500 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67502 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67504 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67506 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67508 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67510 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67512 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67514 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67516 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
67467 67518 27 tomcat 0.0 22:00  22:23 /usr/sbin/httpd 
68283 68283 1 sdlansi 0.0 22:22  00:00 grep --color=auto 67467 

詳細請幫助我,我怎麼能檢查我的配置被應用與否。 以上文物都出現 ThreadsPerChild是

在httpd.conf我已經添加下面的配置調整甚至MPM,只有3臺服務器與25運行 - 完成後重新啓動我的Apache服務器應用

<IfModule mpm_event_module> 
      StartServers    6   #default 3 
      ServerLimit    512  #default 16 
      ThreadsPerChild   25  #25 
      MaxRequestWorkers  12800  #default 400(16x25) 
      AsyncWorkerFactor   2 
      MinSpareThreads   64  # MaxRequestWorkers/4 
      MaxSpareThreads   256  #64 MinSpareThreads * 3 
      MaxConnectionsPerChild  0 
</IfModule> 

Apache服務器的細節是

[[email protected] ~]# apachectl -V 
Server version: Apache/2.4.4 (Unix) 
Server built: Apr 16 2014 17:28:21 
Server's Module Magic Number: 20120211:11 
Server loaded: APR 1.5.0, APR-UTIL 1.5.3 
Compiled using: APR 1.5.0, APR-UTIL 1.5.3 
Architecture: 64-bit 
Server MPM:  event 
    threaded:  yes (fixed thread count) 
    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="/usr" 
-D SUEXEC_BIN="/usr/sbin/suexec" 
-D DEFAULT_PIDLOG="/var/run/httpd.pid" 
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status" 
-D DEFAULT_ERRORLOG="logs/error_log" 
-D AP_TYPES_CONFIG_FILE="/etc/httpd/conf/mime.types" 
-D SERVER_CONFIG_FILE="/etc/httpd/conf/httpd.conf" 

機:8芯16 GB

回答

0

您可以使用名爲check_httpd_limits的模塊來檢查您的apache的哪個事件類型。它將顯示apache正在使用的配置參數和它們各自的值。有關詳細信息,請通過以下鏈接。

https://github.com/jsmoriss/check-httpd-limits

+0

感謝卡蘭,該腳本從httpd.conf文件讀取。有沒有任何工具/命令可以幫助我檢查我的配置是否適用? –

0

解決了!我的觀察是正確的。

現在它顯示所有配置的工人和StartServers的

enter image description here