Apache 2.4在首次响应之前有很长的延迟

我用Apache 2.4在本地networking中testing服务器(Centos 7)。 所有的工作正常,但每次约1小时后,无效阿帕奇回应滞后约4.8秒。 接下来的请求非常快(1-5毫秒)。

连接后出现延迟(连接 – 1ms,请求发送 – 1ms,等待TTFB – 4.8s)。 无论请求的源(HTML页面,HTML + PHP或只是图像)types的问题发生。 另一个networking应用程序工作无瓦特。

IPv6禁用。 在httpd.conf中configuration的IP和端口:


ServerRoot "/etc/httpd" Listen 192.168.0.100:80 KeepAlive On MaxKeepAliveRequests 0 KeepAliveTimeout 300 Include conf.modules.d/*.conf User apache Group apache ServerAdmin root@localhost ServerName 192.168.0.100:80 <Directory /> Options Indexes FollowSymLinks AllowOverride all Require all granted </Directory> DocumentRoot "/Site" <Directory "/Site/www"> AllowOverride None # Allow open access: Require all granted </Directory> <Directory "/Site/www"> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> <IfModule dir_module> DirectoryIndex index.html </IfModule> <Files ".ht*"> Require all denied </Files> ErrorLog "logs/error_log" LogLevel warn <IfModule log_config_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> CustomLog "logs/access_log" combined </IfModule> <IfModule alias_module> ScriptAlias /cgi-bin/ "/Site/cgi-bin/" </IfModule> <Directory "/Site/cgi-bin"> AllowOverride None Options None Require all granted </Directory> <IfModule mime_module> TypesConfig /etc/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType text/html .shtml AddOutputFilter INCLUDES .shtml </IfModule> AddDefaultCharset UTF-8 <IfModule mime_magic_module> MIMEMagicFile conf/magic </IfModule> EnableSendfile on IncludeOptional conf.d/*.conf 

Chrome调试器

这是否发生单一或连接? 如果一小时之后,您从客户端A发起连接,客户端B是否也有快速响应?

如果没有,那么可能与保活超时有关。 如果是,那么它可能是与caching相关的东西

我做了很less的testing,发现只有Windows(Win7)机器(PC和笔记本电脑)出现滞后。 Mac,iPhone和iPad与服务器无滞后。 所有设备在一个子网(简单DLink路由器)。 滞后与连接types无关(笔记本电脑通过wifi连接,PC通过电线连接),并且与浏览器types无关。 一台PC连接滞后,启动快,另一台连接滞后。 所以我觉得在Windowsnetworking设置的一些问题,而不是涉及到服务器。

UPD:问题出在卡巴斯基反病毒。 我禁用网页filter,现在所有的作品没有滞后。