小编Edi*_*Edi的帖子

Apache 2.4 不关闭连接

我有一个运行在带有 CentOS 的 AWS 微型实例上的Apache 2.4网络服务器。
apache 正在运行带有 prefork MPM 模块的 PHP。
服务器通过 Amazon 负载均衡器访问,该负载均衡器具有健康检查功能,每 60 秒尝试访问服务器的 index.php 网页。

问题是在 1-2 天后,Apache 以某种方式使用 index.php 页面达到了 256 个打开的进程并给出以下错误:

[Sun Sep 08 02:13:00.356051 2013] [mpm_prefork:error] [pid 1201] (12)Cannot allocate memory: AH00159: fork: Unable to fork new process
[Sun Sep 08 02:13:13.656694 2013] [mpm_prefork:error] [pid 1201] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
Run Code Online (Sandbox Code Playgroud)

通常发生这种情况时,不再接受新的 http 连接。

Apache 可能不会关闭负载均衡器的所有连接。
我们有另一台使用 Apache 2.2 的服务器,它没有这个问题,所以问题可能出在 2.4 版本上,它与 2.2 有很大不同(我们没有更改 Apache 的任何默认配置)。 …

php mpm-prefork amazon-web-services apache-2.4

7
推荐指数
1
解决办法
6155
查看次数