Hacker News new | ask | show | jobs
by nickramirez 1291 days ago
You 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.

1 comments

One 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.