我在 ubuntu 上运行 apache 2.4.18。每月服务约 500,000 PI。没有峰值,没什么大不了的。不知何故,它现在开始需要很长时间才能建立初始连接,重新启动 apache 后就恢复正常了。
Chrome 告诉我,初始连接需要很长时间:
几分钟后,我可以通过新的浏览器会话回来,并且看起来正常:
MySQL、PHP 和其余的似乎不是问题,因为重新启动 apache 就可以解决问题,并且所有查询日志都显示高性能。
我的猜测是,apache 配置不是针对 2.4 而是 2.2,因为并发连接似乎有一些命名变化。
这是我的配置的一部分:
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5
这可能是什么问题?