Bird
Raised Fist0
AWScloud~10 mins

Health checks configuration in AWS - Step-by-Step Execution

Choose your learning style10 modes available
Process Flow - Health checks configuration
Start: Configure Health Check
↓
Set Protocol, Port, Path
↓
Define Interval & Timeout
↓
Set Healthy & Unhealthy Thresholds
↓
Load Balancer Sends Health Requests
↓
Check Response: Success or Fail
↓
Update Instance Health Status
↓
Use Health Status for Traffic Routing
↓
End
This flow shows how health checks are configured and used to monitor instance health and route traffic accordingly.
Execution Sample
AWS
HealthCheck:
  Protocol: HTTP
  Port: 80
  Path: /health
  IntervalSeconds: 30
  TimeoutSeconds: 5
  HealthyThresholdCount: 3
  UnhealthyThresholdCount: 2
Defines a health check that sends HTTP requests every 30 seconds to /health on port 80, marking instances healthy or unhealthy based on response.
Process Table
StepActionHealth Check Request SentResponse ReceivedHealth Status UpdateTraffic Routing
1Send health check to instanceHTTP GET /health on port 80200 OKInstance marked healthy count 1Instance does not receive traffic
2Send health check to instanceHTTP GET /health on port 80200 OKInstance marked healthy count 2Instance does not receive traffic
3Send health check to instanceHTTP GET /health on port 80200 OKInstance marked healthy count 3 (healthy threshold met)Instance confirmed healthy, receives traffic
4Send health check to instanceHTTP GET /health on port 80500 ErrorInstance marked unhealthy count 1Instance still receives traffic
5Send health check to instanceHTTP GET /health on port 80TimeoutInstance marked unhealthy count 2 (unhealthy threshold met)Instance marked unhealthy, traffic stopped
6Send health check to instanceHTTP GET /health on port 80200 OKInstance marked healthy count 1Instance still does not receive traffic
7Send health check to instanceHTTP GET /health on port 80200 OKInstance marked healthy count 2Instance still does not receive traffic
8Send health check to instanceHTTP GET /health on port 80200 OKInstance marked healthy count 3 (healthy threshold met)Instance marked healthy, traffic resumes
9End monitoringNo requestNo responseHealth check monitoring continuesTraffic routed based on latest health status
💡 Health check monitoring runs continuously; traffic routing updates based on health status thresholds.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4After Step 5After Step 6After Step 7After Step 8Final
HealthyCount0123001233
UnhealthyCount0000120000
InstanceHealthUnknownHealthy (pending)Healthy (pending)HealthyUnhealthy (pending)UnhealthyUnhealthy (pending)Unhealthy (pending)Healthy (pending)Healthy
TrafficRoutingNo trafficNo trafficNo trafficReceives trafficReceives trafficNo trafficNo trafficNo trafficReceives trafficReceives traffic
Key Moments - 3 Insights
Why does the instance not immediately become healthy after one successful health check?
Because the HealthyThresholdCount is 3, the instance must pass 3 consecutive successful checks before being marked healthy, as shown in steps 1-3 in the execution_table.
Why does traffic stop only after two failed health checks?
The UnhealthyThresholdCount is 2, so the instance must fail 2 consecutive checks before being marked unhealthy and traffic is stopped, as seen in steps 4-5.
What happens if the instance recovers after being unhealthy?
It must pass the healthy threshold count again (3 successful checks) before traffic resumes, as shown in steps 6-8.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the HealthyCount after step 3?
A2
B3
C1
D0
💡 Hint
Check the 'HealthyCount' variable in variable_tracker after step 3.
At which step does the instance stop receiving traffic due to health check failure?
AStep 4
BStep 3
CStep 5
DStep 6
💡 Hint
Look at the 'TrafficRouting' column in execution_table where traffic changes to stopped.
If the UnhealthyThresholdCount was set to 1, how would the traffic routing change after step 4?
ATraffic would stop immediately after step 4
BTraffic would continue as normal
CTraffic would stop after step 5
DTraffic would never stop
💡 Hint
Refer to how UnhealthyThresholdCount affects traffic routing in execution_table steps 4 and 5.
Concept Snapshot
Health checks monitor instance health by sending requests at intervals.
Set protocol, port, and path for checks.
Define thresholds for healthy/unhealthy counts.
Instance marked healthy after consecutive successes.
Instance marked unhealthy after consecutive failures.
Traffic routed only to healthy instances.
Full Transcript
Health checks configuration involves setting up periodic requests from a load balancer to instances to verify their health. The configuration includes protocol, port, path, interval, timeout, and thresholds for marking instances healthy or unhealthy. The load balancer sends requests at the defined interval and waits for responses within the timeout. If an instance responds successfully enough times consecutively, it is marked healthy and receives traffic. If it fails enough times consecutively, it is marked unhealthy and traffic is stopped. This process repeats continuously to ensure traffic is only sent to healthy instances.

Practice

(1/5)
1. What is the main purpose of a health check in AWS services like Elastic Load Balancer?
easy
A. To verify if a server or service is responding correctly
B. To increase the server's CPU capacity automatically
C. To backup data from the server regularly
D. To encrypt data sent between servers

Solution

  1. Step 1: Understand the role of health checks

    Health checks monitor if a server or service is working properly by sending requests and checking responses.
  2. Step 2: Identify the main goal

    The main goal is to detect unhealthy servers so they can be removed from traffic, ensuring reliability.
  3. Final Answer:

    To verify if a server or service is responding correctly -> Option A
  4. Quick Check:

    Health check purpose = verify server response [OK]
Hint: Health checks confirm server responsiveness, not capacity or backups [OK]
Common Mistakes:
  • Confusing health checks with scaling or backup tasks
  • Thinking health checks encrypt data
  • Assuming health checks improve server hardware
2. Which of the following is the correct way to configure a health check path for an HTTP service in AWS Elastic Load Balancer?
easy
A. HealthCheckInterval: 60
B. HealthCheckPath: "/status"
C. HealthCheckProtocol: TCP
D. HealthCheckPort: 8080

Solution

  1. Step 1: Identify the correct parameter for HTTP path

    For HTTP health checks, the path to check is set using HealthCheckPath with a URL path string.
  2. Step 2: Differentiate from other parameters

    HealthCheckPort sets the port, HealthCheckProtocol sets the protocol, and HealthCheckInterval sets the time between checks, not the path.
  3. Final Answer:

    HealthCheckPath: "/status" -> Option B
  4. Quick Check:

    HTTP health check path = HealthCheckPath [OK]
Hint: Path is set with HealthCheckPath, not port or interval [OK]
Common Mistakes:
  • Using HealthCheckPort to set the path
  • Confusing protocol with path
  • Setting interval instead of path
3. Given this health check configuration for a load balancer:
IntervalSeconds: 30
TimeoutSeconds: 5
HealthyThresholdCount: 3
UnhealthyThresholdCount: 2

How many consecutive failed health checks will cause the instance to be marked unhealthy?
medium
A. 30
B. 3
C. 5
D. 2

Solution

  1. Step 1: Understand UnhealthyThresholdCount meaning

    This value defines how many failed health checks in a row mark the instance unhealthy.
  2. Step 2: Identify the value from configuration

    UnhealthyThresholdCount is set to 2, so after 2 failed checks, the instance is unhealthy.
  3. Final Answer:

    2 -> Option D
  4. Quick Check:

    Failed checks to unhealthy = UnhealthyThresholdCount = 2 [OK]
Hint: UnhealthyThresholdCount = failed checks before unhealthy [OK]
Common Mistakes:
  • Confusing HealthyThresholdCount with unhealthy count
  • Using IntervalSeconds as count
  • Assuming timeout affects count
4. You configured a health check with TimeoutSeconds set to 10 seconds, but your service responds in 3 seconds. The health check still fails. What is the most likely cause?
medium
A. HealthyThresholdCount is set too low
B. TimeoutSeconds is too high causing failure
C. The health check path is incorrect or unreachable
D. IntervalSeconds is set to 1 second

Solution

  1. Step 1: Analyze TimeoutSeconds vs response time

    TimeoutSeconds is 10, service responds in 3 seconds, so timeout is not the issue.
  2. Step 2: Consider other causes for failure

    If health check fails despite quick response, likely the path is wrong or the service is unreachable.
  3. Final Answer:

    The health check path is incorrect or unreachable -> Option C
  4. Quick Check:

    Fast response but failure = wrong path/unreachable [OK]
Hint: Fast response but failure? Check health check path [OK]
Common Mistakes:
  • Assuming timeout too high causes failure
  • Confusing threshold counts with timeout
  • Ignoring path correctness
5. You want to configure a health check for a web service behind an AWS Application Load Balancer. The service sometimes takes up to 8 seconds to respond under load. Which configuration best ensures accurate health status without false failures?
hard
A. Set TimeoutSeconds to 10, IntervalSeconds to 30, HealthyThresholdCount to 3, UnhealthyThresholdCount to 2
B. Set TimeoutSeconds to 5, IntervalSeconds to 10, HealthyThresholdCount to 2, UnhealthyThresholdCount to 2
C. Set TimeoutSeconds to 3, IntervalSeconds to 5, HealthyThresholdCount to 5, UnhealthyThresholdCount to 5
D. Set TimeoutSeconds to 1, IntervalSeconds to 15, HealthyThresholdCount to 1, UnhealthyThresholdCount to 1

Solution

  1. Step 1: Match TimeoutSeconds to max response time

    The service can take up to 8 seconds, so TimeoutSeconds should be at least 8 to avoid false failures. Set TimeoutSeconds to 10, IntervalSeconds to 30, HealthyThresholdCount to 3, UnhealthyThresholdCount to 2 sets 10 seconds, which is suitable.
  2. Step 2: Choose thresholds and intervals for stability

    Longer IntervalSeconds (30) and thresholds (3 healthy, 2 unhealthy) help avoid flapping due to temporary slow responses.
  3. Step 3: Evaluate other options

    Options A, C, and D have TimeoutSeconds too low or thresholds too sensitive, risking false unhealthy marks.
  4. Final Answer:

    Set TimeoutSeconds to 10, IntervalSeconds to 30, HealthyThresholdCount to 3, UnhealthyThresholdCount to 2 -> Option A
  5. Quick Check:

    Timeout ≥ max response + stable thresholds = Set TimeoutSeconds to 10, IntervalSeconds to 30, HealthyThresholdCount to 3, UnhealthyThresholdCount to 2 [OK]
Hint: Timeout must exceed max response time to avoid false failures [OK]
Common Mistakes:
  • Setting TimeoutSeconds less than max response time
  • Using too low thresholds causing flapping
  • Ignoring service response variability
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard