VPS侦探论坛

 找回密码
 注册
查看: 6242|回复: 9

军哥大神,求助:关于php-fpm问题, 动态页面一直出现502

[复制链接]
发表于 2016-2-27 13:18:03 | 显示全部楼层 |阅读模式

问下,为何非要有php-fpm这个步骤?优化来优化去,还是那个样,真的很蛋疼,来来去去还是502错误

VPS是LINODE,1GRAM 1CPU

现在设置这样
[global]
pid = /usr/local/php/var/run/php-fpm.pid
error_log = /usr/local/php/var/log/php-fpm.log
log_level = notice
[www]
listen = /tmp/php-cgi.sock
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
listen.owner = www
listen.group = www
listen.mode = 0666
user = www
group = www
pm = dynamic
pm.max_children = 16
pm.start_servers = 2
pm.min_spare_servers = 16
pm.max_spare_servers = 16
request_terminate_timeout = 300
request_slowlog_timeout = 20
slowlog = var/log/slow.log

++++++++++++++++++++++++++
PHP-FPM日志:

01-Feb-2016 12:08:25] NOTICE: fpm is running, pid 3427
[01-Feb-2016 12:08:25] NOTICE: ready to handle connections
[01-Feb-2016 12:36:01] NOTICE: Finishing ...
[01-Feb-2016 12:36:01] NOTICE: exiting, bye-bye!
[01-Feb-2016 12:36:02] NOTICE: fpm is running, pid 3499
[01-Feb-2016 12:36:02] NOTICE: ready to handle connections
[01-Feb-2016 14:27:03] NOTICE: Terminating ...
[01-Feb-2016 14:27:03] NOTICE: exiting, bye-bye!
[01-Feb-2016 14:27:33] NOTICE: fpm is running, pid 2151
[01-Feb-2016 14:27:33] NOTICE: ready to handle connections
[01-Feb-2016 14:31:26] WARNING: [pool www] child 2152, script '/home/wwwroot/default/phpmyadmin/import.php' (request: "POST /phpmyadmin/import.php") execution timed out (110.744398 sec), terminating
[01-Feb-2016 14:31:26] WARNING: [pool www] child 2152 exited on signal 15 (SIGTERM) after 233.357944 seconds from start
[01-Feb-2016 14:31:26] NOTICE: [pool www] child 2677 started
[01-Feb-2016 14:56:00] NOTICE: Terminating ...
[01-Feb-2016 14:56:00] NOTICE: exiting, bye-bye!
[01-Feb-2016 14:56:32] NOTICE: fpm is running, pid 2152
[01-Feb-2016 14:56:32] NOTICE: ready to handle connections
[02-Feb-2016 00:01:47] NOTICE: Terminating ...
[02-Feb-2016 00:01:47] NOTICE: exiting, bye-bye!
[02-Feb-2016 00:02:18] NOTICE: fpm is running, pid 2151
[02-Feb-2016 00:02:19] NOTICE: ready to handle connections
[02-Feb-2016 12:13:54] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 6 total children
[02-Feb-2016 12:13:55] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or

[ 本帖最后由 Wention 于 2016-2-27 14:39 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-2-27 13:53:58 | 显示全部楼层


很蛋疼,各位大神,如何解决呢???????????
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-2-27 14:03:17 | 显示全部楼层

要么得重启php-fpm要么得重启mysql,也是醉了

[ 本帖最后由 Wention 于 2016-2-27 14:05 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-2-27 14:34:32 | 显示全部楼层



顶上去给大神看下,求大神解救,拜谢
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2016-2-27 14:39:37 | 显示全部楼层

只看这个日志,你再phpmyadmin里导入数据时超时了,这个很正常,php都是有超时时间的,如想用这个方法按置顶帖502排查方法修改执行时间

最简单的方法就是mysql命令导入:https://www.vpser.net/manage/mysql-import-export.html

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2016-2-27 17:05:00 | 显示全部楼层

回复 5# 的帖子


但是我不是导入的啊,都用一段时间了啊
发表于 2016-2-27 21:48:11 | 显示全部楼层

回复 6# 的帖子


你的php-fpm的日志就那几条

你这慢日志好几万条没法,有具体的502的时段没
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-2-28 01:46:06 | 显示全部楼层

回复 7# 的帖子


那我再上传下php-fpm的日志吧,,时间段就是白天动态页面都会502或者打开卡的不要不要的,晚上一过12点就很流畅,早上6点开始就开始了

[ 本帖最后由 Wention 于 2016-2-28 12:17 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2016-2-28 19:47:12 | 显示全部楼层


[0x00007f819744f6f8] M() /home/wwwroot/zuixia.net/Runtime/~app.php:1
[0x00007f819744d378] ff_mysql_vod() /home/wwwroot/zuixia.net/Runtime/Cache/Home/2aa95f0cefeeed9fd81e722ce7ab4fe8.php:92

大部分都是提示这个,找这个两个文件,排查提示的函数看看

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2016-2-29 19:06:52 | 显示全部楼层

回复 9# 的帖子




问题解决了一半了,主要是我开了百度云的CDN,所以导致后台和动态文件被缓存,现在用360CDN好多了,不过采集和后台生成的话,就会卡死502
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-17 20:26 , Processed in 0.029428 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表