Configuring and Troubleshooting Target Health Checks
This lesson explains how load balancers send traffic only to healthy targets, and why misconfigured health checks are one of the most common causes of outages in exam scenarios.
Learning outcomes
After completing this lesson, you will be able to:
- Configure health check settings.
- Explain health states and fail-open behaviour.
- Fix common causes of unhealthy targets.
Health check settings
Each target group defines a health check protocol and port (the traffic port by default), a path for HTTP and HTTPS checks, an interval (5 to 300 seconds), a timeout, a healthy threshold and unhealthy threshold (consecutive successes or failures), and for ALBs the success codes (200 by default; ranges such as 200-399 are allowed). A good health check path tests that the application can serve requests but does not depend on every downstream system; a check that fails whenever a shared database is slow can mark every target unhealthy at once.
Health states and fail-open behaviour
Targets move through states: initial (registering), healthy, unhealthy, unused (the target's AZ is not enabled or no listener uses the group), draining (deregistering) and unavailable. The describe-target-health output includes a reason code such as Target.Timeout, Target.ResponseCodeMismatch, Target.FailedHealthChecks or Elb.InitialHealthChecking. If all targets in a target group are unhealthy, an ALB fails open and routes to all of them, on the assumption that the health check is wrong. Target group health settings can define minimum healthy counts that trigger DNS failover away from an AZ.
The following diagram compares normal routing with fail-open routing.

Health states
Common causes of unhealthy targets
The following table lists the reason codes you will see most often and how to fix them.
| Reason code | Likely cause | Fix |
|---|---|---|
| Target.Timeout | Security group or NACL blocks the load balancer, or the application is not listening | Allow the load balancer's security group on the health check port |
| Target.ResponseCodeMismatch | Path returns 301, 302, 403 or 404 | Use a path that returns 200, or widen success codes |
| Target.FailedHealthChecks | Application errors or crashes | Check application logs |
| Elb.InitialHealthChecking | New target still being checked | Wait, or tune interval and thresholds |
| Target.NotInUse | Target's AZ not enabled on the load balancer | Enable the AZ or move the target |
Health reason codes
All targets unhealthy after hardening
After a security team replaced a web tier's security group, every target shows Target.Timeout, yet the site still loads intermittently because the ALB fails open. The new security group allows HTTPS from the corporate network only, so the ALB cannot reach the targets on port 8080, the traffic and health check port. Adding an inbound rule that allows port 8080 from the ALB's security group, rather than from a CIDR range, restores health checks and keeps the targets closed to everything else.
What does Target.ResponseCodeMismatch usually indicate?
Show answer
The health check path redirects or does not exist, so the response is not a success code.
Exam Tips
Remember for the exam
- Health checks use the path, port, interval, thresholds and success codes of the target group.
- Target.Timeout usually means the security group does not allow the load balancer.
- Target.ResponseCodeMismatch usually means a redirect or missing path.
- If all targets are unhealthy, an ALB fails open.
- Reference the load balancer's security group in target security groups.