nginx fpm 常见错误对比分析

fastcgi_read_timeout 8; // nginx.conf
request_terminate_timeout=0 // php-fpm.conf

浏览器 8 秒后返回 504 Gateway Time-out

nginx-error.log
upstream timed out (110: Connection timed out) while reading response header from upstream

 

fastcgi_read_timeout 8; // nginx.conf
request_terminate_timeout=5 // php-fpm.conf

浏览器 5 秒后返回 502 Bad Gateway

nginx-error.log
recv() failed (104: Connection reset by peer) while reading response header from upstream
fpm-error.log
[pool www] child 5378, script ‘/usr/share/nginx/html/sleep.php’ (request: “GET /sleep.php”) execution timed out (5.793874 sec), terminating

 

fastcgi_read_timeout 8; // nginx.conf
request_terminate_timeout=5 // php-fpm.conf

浏览器返回 500 Internal Server Error
php-error.log
[08-Apr-2017 23:39:44 Asia/Shanghai] PHP Fatal error: Maximum execution time of 1 second exceeded in /usr/share/nginx/html/while_true.php on line 3

留下评论