首页| 论坛| 消息
主题:pstream timed out (110: Connection timed out) while reading response header from upstream..
北斗星发表于 2019-04-02 14:34
经测试,问题出在php-fpm,php代码要使用file存取session,读写数据库,其中有一项操作缓慢,都能造成nginx假死;
解决方案:
打开php-fpm慢日志:
mkdir /var/log/php-fpm && chown nginx:nginx /var/log/php-fpm
vi /etc/php7/fpm/php-fpm.d/www.conf
修改:
request_slowlog_timeout = 2s
request_terminate_timeout = 30s
slowlog = /var/log/php-fpm/$pool.log.slow
重启nginx和php-fpm
刷新页面,页面一直停留在阻塞状态,没有反应,这时,
tailf/var/log/php-fpm/www.log.slow
可以清楚看到执行慢的语句和操作,这样就能找到具体原因!
回帖(2):
2楼:0 0-23/6 * * * /bin/bash /opt/data/bash/backup.sh
0 0-23/1 * * * /bin/bash /opt/data/b ..
1楼:http://www.ttlsa.com/nginx/nginx-upstream-timed-out-110-connection-timed-out/
https:// ..

全部回帖(2)»
最新回帖
收藏本帖
发新帖