Skip to content

How do I troubleshoot Amazon EC2 Auto Scaling issues in my Elastic Beanstalk environment?

3 minute read
0

I want to diagnose and resolve Amazon Elastic Compute Cloud (Amazon EC2) Auto Scaling issues in my AWS Elastic Beanstalk environment.

Resolution

Auto scaling issues in Elastic Beanstalk might occur because of instance launch failures, health check issues, or misconfigured scaling policies.

My Amazon EC2 Auto Scaling group continuously replaces the instances

Identify why your Amazon EC2 Auto Scaling groups unexpectedly stopped your Amazon EC2 instances. If the Amazon EC2 Auto Scaling group stopped an unhealthy instance, then check the instance health check status. To resolve health check failures, see Troubleshoot unhealthy instances in Amazon EC2 Auto Scaling.

You can also download the Elastic Beanstalk application logs to find the reason for the health check issues. Check the following files for deployment failures:

  • /var/log/eb-engine.log
  • /var/log/cfn-init-cmd.log
  • /var/log/cfn-init.log

To identify application traffic issues, check the following web server access and error logs:

  • /var/log/nginx/access.log
  • /var/log/nginx/error.log
  • (Apache only) /var/log/httpd/access_log
  • (Apache only) /var/log/httpd/error_log

If you use a Windows instance, then check the following files for deployment failures:

  • For CloudFormation initialization logs, check C:\cfn\log\cfn-init.log.
  • For Elastic Beanstalk logs, check C:\Program Files\Amazon\ElasticBeanstalk\logs\.

To identify application traffic issues on your Windows instance, check the following log files:

  • For Microsoft Internet Information Services (IIS) access logs, check C:\inetpub\logs\LogFiles\W3SVC1\.
  • For HTTP error logs, check C:\Windows\System32\LogFiles\HTTPERR\.
  • For Windows Event Logs, such as Application, System, and Security, check the Windows Event Viewer console. For more information, see Event Viewer on the Microsoft Learn website.

My Amazon EC2 Auto Scaling group doesn't scale before 100% CPU utilization

If your Amazon EC2 Auto Scaling group uses Average statistics, then your Amazon EC2 Auto Scaling group might not respond to the sudden increase in traffic. As a result, the CPU utilization maximum value can reach 100% while the average is still below the threshold you have set.

To resolve this issue, change the Statistic setting from Average to Maximum.

My Amazon Auto Scaling group has frequent and unnecessary scaling events

Narrow threshold configurations creates a window between scale-up and scale-down triggers that cause reactive scaling cycles.

To resolve this issue, complete the following steps:

  1. Increase the gap between the Upper threshold and Lower threshold settings of the Amazon CloudWatch alarms.
  2. Implement cooldown periods.
  3. Perform load testing and then use the historical load patterns and previous CloudWatch metrics for your application to fine-tune these settings. For example, use Historical CPU Utilization, Memory Utilization, Disk Utilization, and Network Bandwidth Utilization.

Related information

Using Locust on AWS Elastic Beanstalk for Distributed Load Generation and Testing

AWS OFFICIALUpdated 5 days ago