Health Check Configuration for ALBs
What you'll learn: How to configure health checks on Application Load Balancers to automatically detect and avoid unhealthy targets.
The Core Idea
Health checks are how your ALB determines which targets in your target group are actually ready to receive traffic. Think of it like a teacher taking attendance—except instead of calling names once, the ALB repeatedly "pings" each target to verify it's alive and responding properly.
Without proper health checks, your ALB might send user requests to servers that are crashed, stuck, or otherwise broken—leading to failed requests and frustrated users.
How Health Checks Work
When you configure a health check, you specify:
- HTTP endpoint: The specific path the ALB should request (e.g.,
/health,/status,/api/ping) - Interval: How often to check (e.g., every 30 seconds)
- Timeout: How long to wait for a response before giving up (e.g., 5 seconds)
- Healthy threshold: How many consecutive successes before marking a target healthy (e.g., 2)
- Unhealthy threshold: How many consecutive failures before marking a target unhealthy (e.g., 3)
- Success codes: Which HTTP status codes indicate health (e.g.,
200,200-299,200,202)
The ALB sends HTTP requests to each target at the specified interval. If the target responds with a matching status code within the timeout period, that's a "success." Once a target passes the healthy threshold, it receives traffic. If it fails the unhealthy threshold, the ALB stops routing requests to it until it recovers.
Why This Matters
Proper health checks prevent users from hitting broken servers, dramatically improving reliability without manual intervention.
Key Takeaway: Health checks use configurable HTTP endpoints, intervals, thresholds, and status codes to automatically monitor target availability and protect users from being routed to unhealthy servers.