服务器已达到 MaxRequestWorkers 设置

服务器已达到 MaxRequestWorkers 设置

新的 8 GB 专用服务器在高峰时段停止工作,在 Apache error.log 中,我发现以下错误:

[mpm_prefork:error] [pid 7565] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
[mpm_prefork:notice] [pid 7565] AH00169: caught SIGTERM, shutting down

该网站运行于 PHP 7.1.2、Apache/2.4.10 (Debian)、FPM/FastCGI 上,安装如下本教程

经过一番研究,我进行了修改/etc/apache2/mods-available/mpm_prefork.conf,但服务器仍然在高峰时段瘫痪并继续出现相同的错误。

的最新更新mpm_prefork.conf是:

<IfModule mpm_prefork_module>
    StartServers             20
    MinSpareServers       5
    MaxSpareServers      10
    MaxRequestWorkers     1024
    ServerLimit   1024
    MaxConnectionsPerChild   0
</IfModule>

让我担心的问题是,无论 中的值是什么mpm_prefork.conf,大约 6GB 的 Ram 总是空闲的。我假设某些文件被覆盖/etc/apache2/mods-available/mpm_prefork.conf,服务器会忽略此文件,如果没有,那么我肯定写了不适当的设置。

您能否提供一些关于如何配置该mpm_prefork.conf文件或哪些文件可以覆盖该文件的想法?

答案1

我遇到了这个问题,结果发现我的查询很慢,php 需要几秒钟才能完成,从而积累了进程。因此,在更改 apache 配置之前,请检查您的慢速日志。

相关内容