Your health check removes a dead endpoint from DNS in 10 seconds. Why do users still fail for longer?
Sketch your own answer first, then compare it with the one below.
A strong answer
Resolvers cached the old answer, and they keep it until the TTL ends. A resolver that refreshed just before the change keeps the dead address for one full TTL. So the worst case is the detection time plus the TTL.
Some resolvers and applications hold answers longer than the TTL, so the real delay can be longer still.
To cut it, use a short TTL on records you may need to move, let clients retry another address when one fails, and put a load balancer or anycast address in front so that failover does not depend on caches.
Sources
- Paul Mockapetris (1987). RFC 1034: Domain Names, Concepts and Facilities.
- Paul Mockapetris (1987). RFC 1035: Domain Names, Implementation and Specification.