One of twelve backends has started answering slowly after a disk problem, yet it still passes its health check. What do you do at the balancer?
Sketch your own answer first, then compare it with the one below.
A strong answer
The health check passes because a probe is a cheap request that does not touch the slow disk. The signal has to come from real traffic, which is what outlier detection does. The balancer tracks each backend's errors and timeouts and temporarily ejects one that stands out, either after a run of consecutive failures or because its success rate is a statistical outlier compared with its peers.
A queue-aware strategy such as least connections or power of two choices helps already. The slow backend's queue is longer, so it loses comparisons and receives less. It does not remove the backend, though, and the requests it still receives are slow.
Ejection needs guard rails. Cap the share of the pool that can be ejected at once, because if the cause is a shared database, every backend looks bad and a naive rule would eject them all. Grow the ejection time each time the same host is ejected again, so a flapping host spends longer out and the pool does not oscillate. Return a host with a gentle slow start, not at full share.
Judge the host against its peers, not against a fixed number. If all twelve are slow, that is not an outlier and ejecting anything will not help.
Sources
- Envoy project (2024). Outlier detection, Envoy architecture overview.
- Jeffrey Dean, Luiz André Barroso (2013). The Tail at Scale.