五、 recv() failed (104: Connection reset by peer) while reading response header from upstream
可能的原因机房网络丢包或者机房有硬件防火墙禁止访问该域名
但最重要的是程序里要设置好超时,不要使用php-fpm的request_terminate_timeout,
最好设成request_terminate_timeout=0;
因为这个参数会直接杀掉php进程,然后重启php进程,这样前端nginx就会返回104: Connection reset by peer。这个过程是很慢,总体感觉就是网站很卡。
复制代码代码如下:
May 01 10:50:58.044162 [WARNING] [pool www] child 4074, script '/usr/local/nginx/html/quancha/sameip/detail.php' execution timed out (15.129933 sec), terminating
May 01 10:50:58.045725 [WARNING] [pool www] child 4074 exited on signal 15 SIGTERM after 90.227060 seconds from start
May 01 10:50:58.046818 [NOTICE] [pool www] child 4082 started