You are currently viewing Application Load Balancer Target Groups Health Checks

Application Load Balancer Target Groups Health Checks

Application Load Balancer Target Groups Health Checks

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post we have discussed Application Load Balancer Target Groups. https://cloudaffaire.com/application-load-balancer-target-groups/

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

Application Load Balancer Target Groups Health Checks:

Your Application Load Balancer periodically sends requests to its registered targets to test their status. These tests are called health checks. Each load balancer node routes requests only to the healthy targets in the enabled Availability Zones for the load balancer. Each load balancer node checks the health of each target, using the health check settings for the target groups with which the target is registered. After your target is registered, it must pass one health check to be considered healthy. After each health check is completed, the load balancer node closes the connection that was established for the health check.

Note: If a target group contains only unhealthy registered targets, the load balancer nodes route requests across its unhealthy targets.

Health Check Settings:

You configure health checks for the targets in a target group using the following settings. The load balancer sends a health check request to each registered target every HealthCheckIntervalSeconds seconds, using the specified port, protocol, and ping path. Each health check request is independent and the result lasts for the entire interval. The time that it takes for the target to respond does not affect the interval for the next health check request. 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 and HTTPS. The default is the HTTP 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: The ping path that is the destination on the targets for health checks. Specify a valid URI (/path?query). The default is /.
  • HealthCheckTimeoutSeconds: The amount of time, in seconds, during which no response from a target means a failed health check. The range is 2–120 seconds. The default is 5 seconds if the target type is instance or ip and 30 seconds if the target type is lambda.
  • HealthCheckIntervalSeconds: The approximate amount of time, in seconds, between health checks of an individual target. The range is 5–300 seconds. The default is 30 seconds if the target type is instance or ip and 35 seconds if the target type is lambda.
  • HealthyThresholdCount: The number of consecutive successful health checks required before considering an unhealthy target healthy. The range is 2–10. The default is 5.
  • UnhealthyThresholdCount: The number of consecutive failed health checks required before considering a target unhealthy. The range is 2–10. The default is 2.
  • Matcher: The HTTP codes to use when checking for a successful response from a target. You can specify values or ranges of values between 200 and 499. The default value is 200.

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. Before a target can receive requests from the load balancer, it must pass the initial health checks. After a target passes the initial health checks, its status is Healthy.

  • 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.

Application Load Balancer Target Groups Health Checks Demo:

Step 1: Create a custom VPC for your ALB.

Step 2: Create two EC2 instances for your ALB target groups.

Step 3: Create your application load balancer.

Application Load Balancer Target Groups Health Checks

Step 4: ALB target group health checks.

Step 5: Cleanup.

Hope you have enjoyed this article, In the next blog post, we will discuss Application Load Balancer monitoring.

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