流量不是特别大的时候,php卡死。

问答中心分类: PHP流量不是特别大的时候,php卡死。
匿名用户 asked 9 年 ago
把php-fpm 服务重启就好了。请问可能是什么原因呢?
流量不是很大,代码也不复杂,没有死循环。
谢谢回答。

5 Answers
oneinstack answered 9 年 ago
并发多少?系统负载多少?服务器什么配置? 是否启用opcache?

cepczkd answered 9 年 ago
TIME_WAIT 282
FIN_WAIT1 22
FIN_WAIT2 7
ESTABLISHED 326
SYN_RECV 2
LAST_ACK 38
 
上面是nginx的数据
 
装了zend,但是在php配置文件把opcache关闭后,也还是有同样的问题
服务器是阿里云2U2G

cepczkd answered 9 年 ago
[12-Jan-2016 13:00:03] WARNING: [pool www] child 6404 exited on signal 15 (SIGTERM) after 1360.040812 seconds from start
[12-Jan-2016 13:02:30] WARNING: [pool www] server reached pm.max_children setting (12), consider raising it
[12-Jan-2016 13:22:12] WARNING: [pool www] server reached pm.max_children setting (12), consider raising it
[12-Jan-2016 13:24:15] WARNING: [pool www] child 9087 said into stderr: "ERROR: Unable to open primary script: /home/wwwroot/oppohn_linux.imkd.net/tz.php (No such file or directory)"
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9110, script '/home/wwwroot/oppohn_linux.imkd.net/1601lppz/index.php' (request: "GET /1601lppz/index.php") execution timed out (153.209742 sec), terminating
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9109, script '/home/wwwroot/oppohn_linux.imkd.net/1601lppz/index.php' (request: "GET /1601lppz/index.php") execution timed out (153.173462 sec), terminating
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9106, script '/home/wwwroot/oppohn_linux.imkd.net/1601lppz/index.php' (request: "GET /1601lppz/index.php") execution timed out (152.753800 sec), terminating
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9104, script '/home/wwwroot/oppohn_linux.imkd.net/1601lppz/index.php' (request: "GET /1601lppz/index.php") execution timed out (152.947819 sec), terminating
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9089, script '/home/wwwroot/oppohn_linux.imkd.net/1601lppz/index.php' (request: "GET /1601lppz/index.php") execution timed out (152.758260 sec), terminating
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9088, script '/home/wwwroot/oppohn_linux.imkd.net/1601lppz/index.php' (request: "GET /1601lppz/index.php") execution timed out (152.540851 sec), terminating
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9087, script '/home/wwwroot/oppohn_linux.imkd.net/1601lppz/index.php' (request: "GET /1601lppz/index.php") execution timed out (153.286787 sec), terminating
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9084, script '/home/wwwroot/oppohn_linux.imkd.net/1601lppz/index.php' (request: "GET /1601lppz/index.php") execution timed out (152.173971 sec), terminating
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9082, script '/home/wwwroot/oppohn_linux.imkd.net/1601lppz/index.php' (request: "GET /1601lppz/index.php") execution timed out (153.234308 sec), terminating
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9089 exited on signal 15 (SIGTERM) after 360.012951 seconds from start
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9110 exited on signal 15 (SIGTERM) after 356.007470 seconds from start
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9109 exited on signal 15 (SIGTERM) after 356.008852 seconds from start
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9106 exited on signal 15 (SIGTERM) after 357.011350 seconds from start
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9087 exited on signal 15 (SIGTERM) after 360.018656 seconds from start
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9084 exited on signal 15 (SIGTERM) after 360.020750 seconds from start
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9082 exited on signal 15 (SIGTERM) after 360.021945 seconds from start
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9088 exited on signal 15 (SIGTERM) after 360.020209 seconds from start
[12-Jan-2016 13:28:07] WARNING: [pool www] child 9104 exited on signal 15 (SIGTERM) after 359.018815 seconds from start
[12-Jan-2016 13:28:33] ERROR: An another FPM instance seems to already listen on /dev/shm/php-cgi.sock
[12-Jan-2016 13:28:33] ERROR: FPM initialization failed
[12-Jan-2016 13:28:36] WARNING: [pool www] server reached pm.max_children setting (12), consider raising it
[12-Jan-2016 13:28:52] WARNING: [pool www] server reached pm.max_children setting (12), consider raising it
[12-Jan-2016 13:31:13] WARNING: [pool www] server reached pm.max_children setting (12), consider raising it
[12-Jan-2016 13:34:43] ERROR: An another FPM instance seems to already listen on /dev/shm/php-cgi.sock

cepczkd answered 9 年 ago
原谅我小白,不懂看日志

oneinstack answered 9 年 ago
代码执行效率不高啊,这么多超时。。并发300多 这个配置不错啦