CentOS + Apache2.4 + PHP5.6 FPM报503错误

Service Unavailable 503错误,很可能的原因是服务器过载。

错误提示:

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

服务器使用Apache2.4,fpm方式加载PHP,因此排查解决过程如下。

1. 查看PHP-FPM日志
#tail -f /alidata/server/php56/var/log/php-fpm.log
WARNING: [pool www] server reached pm.max_children setting (5), consider raising it

2. 修改PHP-FPM配置
#vi /alidata/server/php56/etc/php-fpm.conf
pm.max_children = 5
​修改为
pm.max_children = 100

计算依据参考:https://blog.csdn.net/solmyr_biti/article/details/53955141
pm.max_children = Total RAM dedicated to the web server / Max child process size – in my case it was 85MB
The server has 8GB of RAM, so:
pm.max_children = 6144MB / 85MB = 72



发表评论

邮箱地址不会被公开。