Closed ghost closed 6 years ago
@dschroe
There is health check settings on each backend server. If one of the server goes offline, haproxy will mark the route as a down status and will now dispatch the next request to it.
Before detecting a server offline, haproxy may still try to load balance on that server, and that request may get an error. There is no retry on the request, but you could config the health check to make haproxy detect the backend failure faster.
The healt check seems to be enabled by default: https://cbonte.github.io/haproxy-dconv/configuration-1.5.html#5.2-check
So every request which is sent to an offline instance/route will not be handled because there is no retry policy which would reroute that request to another instance of the same service? How long does it take for the HAProxy to mark an offline service as a dead route per default? 30s?
By default, it is inter 2000 rise 2 fall 3
, you can always use envvar HEALTH_CHECK
to change the value.
You can find more detailed explanation in HAProxy document
BTW, there is also a failover option(envvar FAILOVER
) you can use, see
http://blog.haproxy.com/2014/01/17/emulating-activepassing-application-clustering-with-haproxy/
Is there any possibility to configure a retry policy for HAProxy? For example if there are multiple instances of a backend service and one of these instances goes offline to which the next request will be routed, HAProxy should rather retrying the request with another instance than giving instantly an error.