504 Gateway Time-out 和 502 Bad Gateway相关处理

若报: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

posted @ 2016-10-18 10:26  三百里江山  阅读(196)  评论(0编辑  收藏  举报