最近接手nginx+php的WEB環境維護,發現PHP-cgiCPU很好,也形成負載很高,因而在網上找了些資料,而且針對本身的錯誤,將問題收集再次,而且網上還給瞭解決方案,因此放在這裏留做之後查詢php
an 11 08:54:01.164292 [NOTICE] fpm_children_make(), line 352: child 10088 (pool default) started
Jan 11 08:54:01.164325 [WARNING] fpm_children_bury(), line 215: child 7985 (pool default) exited on signal 15 SIGTERM after 63.778601 seconds from start
Jan 11 08:54:01.165485 [NOTICE] fpm_children_make(), line 352: child 10089 (pool default) started
Jan 11 08:54:01.165514 [WARNING] fpm_children_bury(), line 215: child 7999 (pool default) exited on signal 15 SIGTERM after 60.297326 seconds from start
Jan 11 08:54:01.166696 [NOTICE] fpm_children_make(), line 352: child 10090 (pool default) started
Jan 11 08:54:01.166727 [WARNING] fpm_children_bury(), line 215: child 8000 (pool default) exited on signal 15 SIGTERM after 60.296946 seconds from start
Jan 11 08:54:01.167855 [NOTICE] fpm_children_make(), line 352: child 10091 (pool default) started
以上是php日誌的警告信息nginx
解決方法服務器
一、提高服務器的文件句柄打開打開
/etc/security/limits.conf : (增長)
* soft nofile 51200
* hard nofile 51200
# vi /etc/security/limits.conf 加上
* soft nofile 51200
* hard nofile 51200
二、提高nginx的進程文件打開數
nginx.conf : worker_rlimit_nofile 51200;
三、修改php-fpm.conf文件,主要須要修改2處。
命令 ulimit -n 查看限制的打開文件數,php-fpm.conf 中的選項rlimit_files 確保和此數值一致。
<value name="max_requests">10240</value>
<value name="rlimit_files">51200</value>
四、修改系統內核
# vi /etc/sysctl.conf
底部添加
fs.file-max=51200
到此結束.