Apache Load Balance and 503 Response

503-errorapache-2.4httpPROXY

i have such a enviroment:
We have one our own Web server, which comunicates with other software components (creating pdf documents) over http protocol. Such a software component is called a worker. It takes usuallay 3 minutes to prepare a pdf doucments by a worker. So we insert a apache httpd server as load balancer to make serveral workers working for one our web server.

The whole structure works. But the user get HTTP Response 503 if the server under last.

Attached is the loadbalancer log file. I can't tell what happed.
Can somebody give me a clue?

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)

Best Answer

You're hitting a timeout on 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.

But that is understandable, given that you said your backend needs around 3 minutes to prepare the pdf.

Actually in my opinion 3 minutes is a very long time for a reply, are you sure your workers are correctly working?

If you have to live with those slow replies the only solution i can think of is to set a highier timeout on your Apache load balancer.