Apache - 随机缓慢响应

问题描述 投票:0回答:1

我正在运行 Centos 9 Stream 服务器,使用 Apache 2.4.57。 (包括PHP80)。

我的 /etc/httpd/conf.d 中有几个网站,但每个网站有时加载速度都很慢,从外部位置+服务器所在的家庭内部加载。

一个简单的 PHP 脚本通常需要 0.3 秒来加载,但随机需要 10 秒。 (在所有浏览器、不同电脑和手机上测试)。

我创建了一个 PHP 脚本,该脚本对其中一个站点执行 CURL 请求。这是一些请求的输出:


#############
HTTP Status Code: 200
Execution Time: 0.70845198631287 seconds
#############
#############
HTTP Status Code: 200
Execution Time: 5.4793140888214 seconds
#############
#############
HTTP Status Code: 200
Execution Time: 10.400671958923 seconds
#############
#############
HTTP Status Code: 200
Execution Time: 0.35585999488831 seconds
#############
#############
HTTP Status Code: 200
Execution Time: 5.3742649555206 seconds
#############
#############
HTTP Status Code: 200
Execution Time: 0.35480499267578 seconds
#############
#############
HTTP Status Code: 200
Execution Time: 0.35231900215149 seconds
#############
#############
HTTP Status Code: 200
Execution Time: 21.141779899597 seconds
#############
#############
HTTP Status Code: 200
Execution Time: 0.33730101585388 seconds
#############
#############
HTTP Status Code: 200
Execution Time: 0.33064198493958 seconds
#############
#############
HTTP Status Code: 200
Execution Time: 0.34990406036377 seconds
#############
#############
HTTP Status Code: 200
Execution Time: 0.33158302307129 seconds
#############
---

我在互联网上搜索了好几天,没有一个关于“响应 apache”的解决方案没有帮助。

performance apache response
1个回答
0
投票

问题已修复:我添加了一长串 IP 白名单,

选项索引 FollowSymLinks AllowOverride All 包含/etc/httpd/block-world.conf

包含 /etc/httpd/block-world.conf 包含的格式,例如:允许、拒绝。自 Apache 2.4 起:需要 ip x.x.x.x

这导致了 5 - 10 秒的随机延迟!

© www.soinside.com 2019 - 2024. All rights reserved.