大网数据广告活动
服务器运维问答

Apache timing out during small load spikes

· 52CE 我爱测

I'm running Apache 2.4.17 (prefork) on a Centos 7 server. The server specs are pretty good: 2 x Xeon E5-2697 v3 @ 2.60GHz, 512GB of RAM and 8 SSDs in RAID 10. This Apache server is used to run a PHP software. The normal load is b…

问题原文

原帖链接 · Fernando · CC BY-SA 3.0

I'm running Apache 2.4.17 (prefork) on a Centos 7 server. The server specs are pretty good: 2 x Xeon E5-2697 v3 @ 2.60GHz, 512GB of RAM and 8 SSDs in RAID 10.

This Apache server is used to run a PHP software.

The normal load is between 8 and 15 but due to the server specs, it's very responsive. Also, the number of requests/sec is usually below 300.

I noticed that sometimes Apache will timeout even for local requests. This happens when the requests/sec is higher than 400 and/or the load is 20+.

If I retry the request, it works fine.

Here is the relevant configuration:

Timeout 300
KeepAlive On
MaxKeepAliveRequests 500
KeepAliveTimeout 2

<IfModule mpm_prefork_module>
    ServerLimit 2000
    StartServers            30
    MinSpareServers         20
    MaxSpareServers         80
    MaxRequestWorkers      2000
    MaxConnectionsPerChild   50000
</IfModule>

Some notes:

  1. The Apache error log doesn't show any errors at all.
  2. Even when this happens, the server is responsive. I can access it using SSH and other services works fine.
  3. I have munin installed. When the issue happens at least 50% the RAM is free, CPU usage is ~70% and the I/O usage is very low.

How can I get more information about this problem? What could cause this type of timeout?

已采纳解答

原帖链接 · Fernando · CC BY-SA 3.0

After a lot of tests, configuration changes etc. I couldn't fix this problem with Apache 2.4.

I decided to give Apache 2.2 a try using the same configuration. I only removed a few things that were Apache 2.4 specific directives.

It simply worked. Same server, configuration, application and load. With Apache 2.2 I don't get the timeouts anymore.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-09-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。