開発日記/2010-05-06 の変更点


*今度は別なエラーが出てサーバが止まってしまった。。。。 [#red391fc]

 May  4 14:46:54 dns kernel: [602177.703839] php-cgi invoked oom-killer: gfp_mask=0x280da, order=0, oomkilladj=0
 May  4 14:46:55 dns kernel: [602177.703839] php-cgi cpuset=/ mems_allowed=0
 May  4 14:46:55 dns kernel: [602177.703839] Pid: 5674, comm: php-cgi Not tainted 2.6.31-302-rs #7
 May  4 14:46:55 dns kernel: [602177.703839] Call Trace:

前回はプログラムの問題で高負荷になって止まったけど、今回は本当に高負荷だけでアクセス負荷になってしまった。

これはApacheのチューニングで対処しないと

こんな感じに修正してみました。
 # vi /etc/httpd/conf/httpd.conf
 StartServers       8
 MinSpareServers    5
 MaxSpareServers   20
 #ServerLimit      256
 ServerLimit      30
 #MaxClients       256
 MaxClients       15
 #MaxRequestsPerChild  4000
 MaxRequestsPerChild  150
 MaxRequestsPerChild  500
 RLimitCPU 60
 RLimitMEM 209715200
 # 200M (200x1024x1024)
 RLimitNPROC 10

&color(Red){※RLimitMEMはphp.iniのmemory_limitより大きい数字じゃないと、phpでこんなエラーがでちゃいます。};
 [Thu May 06 13:17:11 2010] [error] [client 202.215.147.106] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/soap.so' - /usr/lib64/php/modules/soap.so: failed to map segment from shared object: Cannot allocate memory in Unknown on line 0, referer: http://matsui.homeunix.com/index.php?cmd=edit&page=%B3%AB%C8%AF%C6%FC%B5%AD%2F2010-05-06
 [Thu May 06 13:24:28 2010] [error] [client 216.129.119.12] FATAL:  erealloc():  Unable to allocate 491520 bytes
 [Thu May 06 13:24:28 2010] [error] [client 216.129.119.12] Premature end of script headers: index.php

後は様子見。