nginx 502 Bad Gateway 错误解决办法

2019-10-17 21:03:38王冬梅

代码:netstat -anpo | grep “php-cgi” | wc -l

5(假如显示5)

2、查看当前进程

代码:top
观察fastcgi进程数,假如使用的进程数等于或高于5个,说明需要增加(根据你机器实际状况而定)

3、调整/usr/local/php/etc/php-fpm.conf 的相关设置

<value name=”max_children”>10</value>
<value name=”request_terminate_timeout”>60s</value>
max_children最多10个进程,按照每个进程20MB内存,最多200MB。
request_terminate_timeout执行的时间为60秒,也就是1分钟。