Course contentsShow
← Cloud and Infrastructure
Lesson 268 of 2,9895. Load Balancing and Traffic ManagementFree lesson

NLB Health Checks

Configure TCP, HTTP, and HTTPS health checks at the transport layer with appropriate thresholds and intervals.

NLB Health Checks

What you'll learn: How Network Load Balancers verify target health using TCP, HTTP, and HTTPS checks at the transport layer.

Why Health Checks Matter for NLBs

Just like a coach checking if players are ready before putting them in the game, NLBs need to know which targets are healthy before sending traffic. Health checks continuously probe your targets to ensure they can handle requests. If a target fails, the NLB stops routing traffic to it until it recovers.

Health Check Protocol Options

NLBs operate at Layer 4 but support three health check protocols:

  • TCP checks: Opens a TCP connection to verify the port responds. Simplest option—if the connection succeeds, the target is healthy.
  • HTTP checks: Sends an HTTP request and expects a specific status code (typically 200). More informative than TCP.
  • HTTPS checks: Like HTTP but over TLS. Verifies SSL/TLS endpoints are responding correctly.

Configuring Check Parameters

You control health check behavior through:

  • Interval: How often to check (e.g., every 30 seconds)
  • Timeout: How long to wait for a response before marking as failed
  • Healthy threshold: Consecutive successes needed to mark target healthy (e.g., 3)
  • Unhealthy threshold: Consecutive failures before marking unhealthy (e.g., 3)

Example scenario: With a 30-second interval, 5-second timeout, and unhealthy threshold of 3, a failing target takes ~90 seconds (3 checks × 30s) to be removed from rotation.

Choosing the Right Protocol

Use TCP for simple connection verification, HTTP/HTTPS when you need to verify application logic (checking a /health endpoint). HTTP checks let you confirm not just that the port answers, but that your application is truly ready.

Key Takeaway: NLB health checks use configurable TCP, HTTP, or HTTPS probes with thresholds and intervals to continuously verify target availability, automatically removing unhealthy targets from rotation.