4 ms·
I don't know if my testing was right. If anyone from HAProxy team reading this. retry count is 3 and you have 5 server in backend and 1 backup server and you h
by haproxy1647849 4y ago
I don't know if my testing was right. If anyone from HAProxy team reading this.
retry count is 3 and you have 5 server in backend and 1 backup server and you have health check.
if all servers are down, request will be forwarded to backup server
but what if all the servers are down, but health check is not updated yet. (extreme timing)
the request will be retried 3 times, servers will be mark down. as all the 3 request were failed, HAProxy will return 503.
I think the request should go to the backup server, even if retry limit was 3, HAProxy was not able connect to any of the 3 server and servers were down actually.
- nickramirez 4y agoYou can think of it as having layers of redundancy. * Retries are one layer. By default set to 3 retries. HAProxy will retry the failed connection or request with the same server. * "option redispatch" is another layer. If HAProxy can't connect to a server that is reporting as healthy, it will send the request to a different server. * health checks are a layer. HAProxy removes unresponsive servers from load balancing. * Backup servers are another layer. If all servers fail their health checks and are down, then backup servers come online to service requests. All these things can be enabled in combination, and it would reduce the chance of a client getting a server error. To answer your question, HAProxy will not connect with a server that is down (failed all its health checks). It will not retry with it either.
- wtarreau 4y agoOne approach that some users who want this mechanism use is the "on-error sudden-death" mechanism: the server responses are inspected, and upon error (from selectable types), the server can be marked dead. If all of them are dead the backup server will come into the dance and the last attempt will end up on it.