Skip to content

Elastic Beanstalk: ELB Health Check Fails During Auto-Scaling Down

0

Hello ,

I am currently using Elastic Beanstalk for my application, and I am facing an issue during the auto-scaling process. Whenever the auto-scaling group decreases the instance count, I receive the following error in my environment's health status:

Environment health has transitioned from Ok to Degraded. ELB processes are not healthy on 1 out of 8 instances. ELB health is failing or not available for 1 out of 8 instances.

How can I solve this problem?

asked 2 years ago415 views

1 Answer
1

To address the issue of ELB health checks failing during auto-scaling down in your Elastic Beanstalk environment, you can take the following steps:

  1. Adjust the health check grace period: The health check grace period is the amount of time Auto Scaling waits before checking the health status of a newly launched instance. Increase this period to give your instances more time to start up and become healthy before they are subject to health checks. You can do this by modifying the Auto Scaling group configuration.

  2. Use ELB health checks for your Auto Scaling group: By default, Auto Scaling uses EC2 status checks, which only detect hardware and software issues. However, ELB health checks are more comprehensive and can detect application-level issues. To enable this:

    a. Create a .ebextensions folder in the root of your source bundle. b. Inside this folder, create a configuration file (e.g., autoscaling.config) with the following content:

    Resources:
      AWSEBAutoScalingGroup:
        Type: "AWS::AutoScaling::AutoScalingGroup"
        Properties:
          HealthCheckType: ELB
          HealthCheckGracePeriod: 300
    

    Adjust the HealthCheckGracePeriod value (in seconds) as needed for your application.

  3. Review your application's health check endpoint: Ensure that your application has a proper health check endpoint that responds quickly and accurately represents the application's health status.

  4. Check instance resources: Verify that your instances have sufficient resources (CPU, memory, etc.) to handle the load during scaling operations.

  5. Investigate application logs: When an instance is marked as unhealthy, examine the application logs to identify any errors or issues that might be causing the health check failures.

  6. Review security groups and network ACLs: Ensure that the security groups and network ACLs allow traffic between the ELB and your instances on the necessary ports.

By implementing these measures, you should be able to improve the stability of your Elastic Beanstalk environment during auto-scaling operations and reduce the occurrence of health check failures.

Sources
AWS elastic beanstalk auto scaling group - Health check grace period value reset after managed update | AWS re:Post
Troubleshoot a Classic Load Balancer: Health checks - Elastic Load Balancing
Auto Scaling health check setting for your Elastic Beanstalk environment - AWS Elastic Beanstalk

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.