504 Gateway Time-out 和 502 Bad Gateway相关处理
2016-10-18 10:26
507 查看
若报:504 Gateway Time-out则与nginx有关
解决方案:
#vim nginx.conf
添加以下代码:
http{
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
}
参考:http://blog.163.com/passc_lee/blog/static/2152541462013593345604/
若报:502 Bad Gateway 则与php-cgi有关
解决方案:
#vim php-fpm.conf
max_children
计算方式:先ps -ef 查看您的php占的内存大小,一般都有内存泄露,常驻内在为60m左右.若内存为4G, 拿出2G做php内存的话,则2048/60 ~=34
request_terminate_timeout
跟据您的请求php执行时间,可设置为5分钟,即300s
解决方案:
#vim nginx.conf
添加以下代码:
http{
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
}
参考:http://blog.163.com/passc_lee/blog/static/2152541462013593345604/
若报:502 Bad Gateway 则与php-cgi有关
解决方案:
#vim php-fpm.conf
max_children
计算方式:先ps -ef 查看您的php占的内存大小,一般都有内存泄露,常驻内在为60m左右.若内存为4G, 拿出2G做php内存的话,则2048/60 ~=34
request_terminate_timeout
跟据您的请求php执行时间,可设置为5分钟,即300s
相关文章推荐
- Nginx 502 bad gateway和Nginx 504 Gateway Time-out错误解决方法 错误解决办法
- Nginx + php-fpm 执行 PHP 脚本超时 报错 502 Bad Gateway + 504 Gateway Time-out 的解决办法
- Nginx 出现 504 Gateway Time-out 和 502 Bad Gateway 的解决办法
- 深究Nginx502 bad gateway, 504 Gateway Time-out的彻底解决
- 深入分析Nginx 502 Bad Gateway和Nginx 504 Gateway Time
- CGI 问题:502 bad gateway以及生成文件过大的处理
- 完美解决Nginx 504 Gateway time-out 502 Bad Gateway
- 解决 502、504 Gateway Time-out(nginx)
- php-fpm 502 bad gateway错误处理
- 解决 502、504 Gateway Time-out(nginx)
- 解决 502、504 Gateway Time-out(nginx)
- 深入分析Nginx 502 Bad Gateway和Nginx 504 Gateway
- 深入分析Nginx 502 Bad Gateway和Nginx 504 Gateway
- Nginx 502 Bad Gateway的处理
- Nginx 502/504 Gateway time-out错误完美解决方案【转发】
- 502 Bad Gateway的处理
- 记一次 An error occurred.(504 Gateway Time-out)错误处理过程
- 解决nginx 504 Gateway Time-out的一些方法
- Nginx 502 Bad Gateway错误的解决办法
- 解决Nginx + PHP(FastCGI)遇到的502 Bad Gateway错误[原创]