You are currently viewing Network Load Balancer Target Group Health Checks

Network Load Balancer Target Group Health Checks

Network Load Balancer Target Group Health Checks

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have discussed Target Groups in Network Load Balancer.

https://cloudaffaire.com/network-load-balancer-target-groups/

In this blog post, we will discuss Network Load Balancer Target Groups health checks.

Network Load Balancer Target Group Health Checks:

Network Load Balancers use active and passive health checks to determine whether a target is available to handle requests. By default, each load balancer node routes requests only to the healthy targets in its Availability Zone. If you enable cross-zone load balancing, each load balancer node routes requests to the healthy targets in all enabled Availability Zones.

With active health checks, the load balancer periodically sends a request to each registered target to check its status. Each load balancer node checks the health of each target, using the health check settings for the target group with which the target is registered. After each health check is completed, the load balancer node closes the connection that was established for the health check.

With passive health checks, the load balancer observes how targets respond to connections. Passive health checks enable the load balancer to detect an unhealthy target before it is reported as unhealthy by the active health checks. You cannot disable, configure, or monitor passive health checks. Passive health checks are not supported for UDP traffic.

If one or more target groups does not have a healthy target in an enabled Availability Zone, we remove the IP address for the corresponding subnet from DNS so that requests cannot be routed to targets in that Availability Zone. If there are no enabled Availability Zones with a healthy target in each target group, requests are routed to targets in all enabled Availability Zones.

Health Check Settings:

You configure active health checks for the targets in a target group using the following settings. If the health checks exceed UnhealthyThresholdCount consecutive failures, the load balancer takes the target out of service. When the health checks exceed HealthyThresholdCount consecutive successes, the load balancer puts the target back in service.

  • HealthCheckProtocol: The protocol the load balancer uses when performing health checks on targets. The possible protocols are HTTP, HTTPS, and TCP. The default is the TCP protocol.
  • HealthCheckPort: The port the load balancer uses when performing health checks on targets. The default is to use the port on which each target receives traffic from the load balancer.
  • HealthCheckPath: [HTTP/HTTPS health checks] The ping path that is the destination on the targets for health checks. The default is /.
  • HealthCheckTimeoutSeconds: The amount of time, in seconds, during which no response from a target means a failed health check. This value must be 6 seconds for HTTP health checks and 10 seconds for TCP and HTTPS health checks.
  • HealthCheckIntervalSeconds: The approximate amount of time, in seconds, between health checks of an individual target. This value can be 10 seconds or 30 seconds. The default is 30 seconds.
  • HealthyThresholdCount: The number of consecutive successful health checks required before considering an unhealthy target healthy. The range is 2 to 10. The default is 3.
  • UnhealthyThresholdCount: The number of consecutive failed health checks required before considering a target unhealthy. This value must be the same as the healthy threshold count.
  • Matcher: [HTTP/HTTPS health checks] The HTTP codes to use when checking for a successful response from a target. This value must be 200 to 399.

Important: Health checks for a Network Load Balancer are distributed and use a consensus mechanism to determine target health. Therefore, targets receive more than the configured number of health checks. To reduce the impact to your targets if you are using HTTP health checks, use a simpler destination on the targets, such as a static HTML file, or switch to TCP health checks.

Target Health Status:

Before the load balancer sends a health check request to a target, you must register it with a target group, specify its target group in a listener rule, and ensure that the Availability Zone of the target is enabled for the load balancer.

  • initial: The load balancer is in the process of registering the target or performing the initial health checks on the target.
  • healthy: The target is healthy.
  • unhealthy: The target did not respond to a health check or failed the health check.
  • unused: The target is not registered with a target group, the target group is not used in a listener rule for the load balancer, or the target is in an Availability Zone that is not enabled for the load balancer.
  • draining: The target is deregistering and connection draining is in process.

Network Load Balancer Target Groups Health Check Demo:

Step 1: Create a custom VPC for your Network Load Balancer.

Step 2: Create two EC2 instances for your Network Load Balancer target.

Step 3: Create your Network Load Balancer.

Step 4: Network Load Balancer Target Group Health Checks.

Step 5: Cleanup.

Hope you have enjoyed this article, In the next blog post, we will discuss how to create an internet-facing network load balancer with static elastic ip address.

All the public cloud providers are changing the console user interface rapidly and due to this some of the screenshots used in our previous AWS blogs are no longer relevant. Hence, we have decided that from now onwards most of the demo will be done programmatically. Let us know your feedback on this in the comment section.

To get more details on AWS ELB, please refer below AWS documentation

https://docs.aws.amazon.com/elasticloadbalancing/index.html

 

Leave a Reply