您的位置:首页 > 其它

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: