recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 120.229.48.101, server: www.2kb.com, request:
不要使用php-fpm的request_terminate_timeout, 最好设成request_terminate_timeout=0;
vi /etc/php-fpm.d/www.2kb.com.conf (默认:/usr/local/php/etc/php-fpm.conf)
修改为:
; The timeout for serving a single request after which the worker process will ; be killed. This option should be used when the ‘max_execution_time’ ini option ; does not stop script execution for some reason. A value of ’0′ means ‘off’. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) ; Default Value: 0 request_terminate_timeout = 0
这个参数会杀掉php进程,重启php进程,这样前端nginx就会返回104: Connection reset by peer。这个过程是很慢,总体感觉就是网站很卡。
重启 php-fpm 和 Nginx 一切正常。
service nginx restart (/usr/local/nginx/sbin/nginx -s stop;/usr/local/nginx/sbin/nginx;)
重启一下php-fpm
/etc/init.d/php-fpm restart
再打开就OK了。
2KB项目(www.2kb.com,源码交易平台),提供担保交易、源码交易、虚拟商品、在家创业、在线创业、任务交易、网站设计、软件设计、网络兼职、站长交易、域名交易、链接买卖、网站交易、广告买卖、站长培训、建站美工等服务