Health Check Intervals and Timeouts
What you'll learn: How to configure health check timing parameters to detect failures quickly without overwhelming your system or triggering false alarms.
The Core Idea
When a load balancer performs health checks (which you learned in the previous two lessons), it needs to decide how often to check each server and how long to wait for a response before declaring the server unhealthy. These two settings—the interval (how frequently checks run) and the timeout (how long to wait for a response)—require careful balancing.
The Tradeoff Triangle
You're juggling three competing concerns:
- Fast failure detection — You want to know immediately when a server goes down so traffic stops routing there
- Low network overhead — Each health check consumes bandwidth and server resources
- Avoiding false positives — A momentary network hiccup shouldn't mark a healthy server as dead
Short intervals (checking every 1-2 seconds) detect failures quickly but generate lots of traffic. Long intervals (every 30-60 seconds) reduce overhead but mean users might hit a dead server for longer before the load balancer notices.
Short timeouts (500ms) catch stuck servers quickly but may flag slow-but-healthy servers as down. Long timeouts (10s) are more forgiving but delay detection of truly failed servers.
Common Configuration Patterns
- Web tier: 5-10 second intervals, 2-3 second timeouts
- Database tier: 10-30 second intervals, 5-10 second timeouts (databases can have legitimate temporary slowdowns)
- High-availability systems: More frequent checks with shorter timeouts
Key Takeaway: Health check intervals and timeouts control the tradeoff between fast failure detection, network efficiency, and false positive rates—tune them based on your system's tolerance for downtime versus resource constraints.