Skip to content

How do I troubleshoot issues with scaling triggers in Elastic Beanstalk?

2 minute read
0

My AWS Elastic Beanstalk environment doesn’t scale the way that I expect it to.

Resolution

Prerequisites:

  • Your Amazon Elastic Compute Cloud (Amazon EC2) instances have sufficient capacity to scale in your AWS Region. This capacity is based on the maximum number of instances that you define in your AWS Auto Scaling group configuration.
  • You have a cooldown period that's based on the installation and configuration requirements of your application.
  • You use default Amazon CloudWatch metrics or Locust to do a load test and identify the best metric to initiate scaling.

To configure your scaling triggers, use either the Elastic Beanstalk console or option settings.

Configure scaling triggers in the Elastic Beanstalk console

  1. Open the Elastic Beanstalk console, and then select your environment.
  2. In the navigation pane for your environment, choose Configuration.
  3. Under Instance traffic and scaling, choose Edit.
  4. Under Capacity, for Scaling Triggers, select your trigger options, and then choose Apply.

Note: Elastic Beanstalk provides configuration options for Auto Scaling settings in the aws:autoscaling:trigger namespace. The resource that a setting applies to organizes the settings in this namespace for that resource.

Configure scaling triggers with option settings

Use .ebextensions in option settings to modify your scaling configurations. To access the configuration file that configures your scaling triggers, see autoscaling-triggers-customize.config on the GitHub website.

The following example configuration file modifies the scaling triggers that are based on CPU utilization. If CPU utilization across instances is more than 80 percent over three consecutive two-minute periods, then Auto Scaling adds one instance to the Auto Scaling group. If CPU utilization across instances is less than 20 percent for the same period, then Auto Scaling removes one instance from the Auto Scaling group.

option_settings:
  aws:autoscaling:trigger:
    MeasureName: CPUUtilization
    Statistic: Average
    Unit: Percent
    Period: '2'
    EvaluationPeriods: '3'
    UpperThreshold: '80'
    UpperBreachScaleIncrement: '1'
    LowerThreshold: '20'
    LowerBreachScaleIncrement: '-1'

The following example shows the structure of the .ebextensions directory and autoscaling-triggers-customize.config file in the application zip file:

~/my-app/
|-- .ebextensions/
|   |-- autoscaling-triggers-customize.config
|   `-- other.config
|-- other application files

Related information

Auto Scaling triggers for your Elastic Beanstalk environment

AWS OFFICIALUpdated 9 months ago
2 Comments

Does not help in the case of missing or damaged cloudwatch components or if scaling is obviously crippled. Needs to be an all encompassing "repair" button in the portal. Also a verbose log would be useful. Good to see negative increments for effective decrements though.

replied 3 years ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

AWS
MODERATOR
replied 3 years ago