我遇到了一个问题:我的 Web 服务器大约每 1-2 天崩溃一次。我查看了日志,发现 Apache 崩溃时会发生以下错误:第一个错误:[Wed May 01 17:11:28....
我遇到了一个问题:我的 Web 服务器大约每 1-2 天崩溃一次。我查看了日志,发现 Apache 崩溃时会发生以下错误:
第一个错误:
[Wed May 01 17:11:28.778759 2024] [mpm_prefork:error] [pid 1430980] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
然后会出现很多警告,之后服务器停止工作
[Wed May 01 17:11:28.778759 2024] [mpm_prefork:error] [pid 1430980] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
[Wed May 01 17:12:25.663388 2024] [fcgid:warn] [pid 1843930] mod_fcgid: process 2119707 graceful kill fail, sending SIGKILL
[Wed May 01 17:12:25.663432 2024] [fcgid:warn] [pid 1843930] mod_fcgid: process 2119872 graceful kill fail, sending SIGKILL
[Wed May 01 17:12:29.069787 2024] [fcgid:warn] [pid 1843930] mod_fcgid: process 2121664 graceful kill fail, sending SIGKILL
[Wed May 01 17:12:29.069831 2024] [fcgid:warn] [pid 1843930] mod_fcgid: process 2121668 graceful kill fail, sending SIGKILL
[Wed May 01 17:12:29.069841 2024] [fcgid:warn] [pid 1843930] mod_fcgid: process 2121670 graceful kill fail, sending SIGKILL
[Wed May 01 17:12:29.069849 2024] [fcgid:warn] [pid 1843930] mod_fcgid: process 2121666 graceful kill fail, sending SIGKILL
[Wed May 01 17:12:29.069856 2024] [fcgid:warn] [pid 1843930] mod_fcgid: process 2121665 graceful kill fail, sending SIGKILL
[Wed May 01 17:12:29.069863 2024] [fcgid:warn] [pid 1843930] mod_fcgid: process 2121663 graceful kill fail, sending SIGKILL
我开始深入研究 mpm_prefork.conf 配置,这是我的配置:
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 150
MaxConnectionsPerChild 0
也许可以尝试增加 MaxRequestWorkers?但我不知道增加到什么程度,也许如果增加,其他参数就需要更改