We started using HAProxy recently and everything works fine so far. However, we are seeing "randomly" some errors on the backend server (Debian + Apache + FCGID + PHP 7) like this:
[Wed Jan 31 08:22:22 2018] [warn] [client XXXX:XXXX::1] (70007)The timeout specified has expired: mod_fcgid: can't get data from http client, referer: XXX
And on the HAProxy server this results in the following log:
Jan 31 08:22:22 localhost haproxy[4029466]: 127.0.0.1:41408 [31/Jan/2018:08:05:12.587] http-in server/myservername 0/0/4/1029610/1029615 500 569 - - CD-- 64/64/0/0/0 0/0 "POST /file.php HTTP/1.1"
As you can see the Tr
and Ta
time is quite high (1000s) for these requests.
We are not seeing any other errors in the log and are wondering what can cause this and how to debug it further? For some reason the backend server seems to not retrieve the data from HAProxy? We aren't able to reproduce this and it happens like only once an hour or so. We have a few servers in the backend and the HAProxy server as well as the backend servers are quite bored (load on powerful HAProxy server is < 0.1).
Here is a part of our HAProxy config (we set the timeouts quite high on purpose):
mode http
log global
timeout connect 10s
timeout client 600s
timeout server 1200s
timeout check 90s
option log-health-checks
option httplog
option log-separate-errors
default-server inter 90s rise 3 fall 3
option httpchk GET check.php
Everything else is quite standard. I should note that we are seeing this only for some POST requests so far, not once for a GET request.
Update: The problem does not occur when we don't use HAProxy and send the traffic directly to a server. So it must be related to HAProxy somehow.
Some of the POST request we may be quite large. Is it possible that we maybe need to adjust some buffer tuning or so? We have logged the content length of such a request using capture request header Content-Length len 10
and the length for such a request that fails is 1084028 (should be > 1MB).