Apache 负载平衡和 503 响应

Apache 负载平衡和 503 响应

我有这样一个环境:我们有一个自己的 Web 服务器,它通过 http 协议与其他软件组件(创建 pdf 文档)通信。这样的软件组件称为 worker。worker 通常需要 3 分钟才能准备一份 pdf 文档。因此,我们插入一个 apache httpd 服务器作为负载平衡器,使多个 worker 为我们的一个 Web 服务器工作。

整个结构都正常工作。但如果服务器处于最后状态,用户将获得 HTTP 响应 503。

附件是负载均衡器日志文件。我不知道发生了什么。有人能给我一点提示吗?

Mon Oct 17 13:55:48.248250 2016] [proxy:debug] [pid 13188:tid 776] proxy_util.c(2173): AH00943: http: has released connection for (worker003.mydomain.com)
[Mon Oct 17 13:55:48.248250 2016] [proxy_balancer:debug] [pid 13188:tid 776] mod_proxy_balancer.c(669): [client 192.168.71.52:63893] AH01176: proxy_balancer_post_request for (balancer://wmpscluster)
[Mon Oct 17 13:56:11.622604 2016] [proxy:debug] [pid 13188:tid 760] proxy_util.c(2173): AH00943: http: has released connection for (worker003.mydomain.com)
[Mon Oct 17 13:56:11.622604 2016] [proxy_balancer:debug] [pid 13188:tid 760] mod_proxy_balancer.c(669): [client 192.168.71.52:54068] AH01176: proxy_balancer_post_request for (balancer://wmpscluster)
[Mon Oct 17 13:56:14.657793 2016] [proxy_http:error] [pid 13188:tid 792] (OS 10060)A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.  : [client 192.168.71.52:51760] AH01102: error reading status line from remote server worker003.mydomain.com:8080
[Mon Oct 17 13:56:14.657793 2016] [proxy_http:debug] [pid 13188:tid 792] mod_proxy_http.c(1264): [client 192.168.71.52:51760] AH01103: read timeout
[Mon Oct 17 13:56:14.657793 2016] [proxy_http:debug] [pid 13188:tid 792] mod_proxy_http.c(1319): [client 192.168.71.52:51760] AH01105: NOT Closing connection to client although reading from backend server worker003.mydomain.com:8080 failed.
[Mon Oct 17 13:56:14.657793 2016] [proxy:error] [pid 13188:tid 792] [client 192.168.71.52:51760] AH00898: Error reading from remote server returned by /plotwmps/servlet/PlotWebConnector
[Mon Oct 17 13:56:14.657793 2016] [proxy:debug] [pid 13188:tid 792] proxy_util.c(2173): AH00943: HTTP: has released connection for (worker003.mydomain.com)
[Mon Oct 17 13:56:14.657793 2016] [proxy_balancer:debug] [pid 13188:tid 792] mod_proxy_balancer.c(669): [client 192.168.71.52:51760] AH01176: proxy_balancer_post_request for (balancer://wmpscluster)
[Mon Oct 17 13:56:50.153795 2016] [proxy:debug] [pid 13188:tid 1032] proxy_util.c(2173): AH00943: http: has released connection for (worker003.mydomain.com)

答案1

您在 Apache 上遇到了超时:

[Mon Oct 17 13:56:14.657793 2016] [proxy_http:error] [pid 13188:tid 792] (OS 10060)A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.  : [client 192.168.71.52:51760] AH01102: error reading status line from remote server worker003.mydomain.com:8080
[Mon Oct 17 13:56:14.657793 2016] [proxy_http:debug] [pid 13188:tid 792] mod_proxy_http.c(1264): [client 192.168.71.52:51760] AH01103: read timeout
[Mon Oct 17 13:56:14.657793 2016] [proxy_http:debug] [pid 13188:tid 792] mod_proxy_http.c(1319): [client 192.168.71.52:51760] AH01105: NOT Closing connection to client although reading from backend server worker003.mydomain.com:8080 failed.

但这是可以理解的,因为你说你的后端需要大约 3 分钟来准备 pdf。

实际上,我认为 3 分钟的回复时间太长了,你确定你的工人在正确地工作吗?

如果您必须忍受这些缓慢的回复,我能想到的唯一解决方案就是在 Apache 负载均衡器上设置更高的超时时间。

相关内容