Menu
Auto Scaling
User Guide

Scheduled Scaling

Scaling based on a schedule allows you to scale your application in response to predictable load changes. For example, every week the traffic to your web application starts to increase on Wednesday, remains high on Thursday, and starts to decrease on Friday. You can plan your scaling activities based on the predictable traffic patterns of your web application.

To configure your Auto Scaling group to scale based on a schedule, you need to create scheduled actions. A scheduled action tells Auto Scaling to perform a scaling action at certain time in future. To create a scheduled scaling action, you specify the start time at which you want the scaling action to take effect, and you specify the new minimum, maximum, and desired size you want for that group at that time. At the specified time, Auto Scaling updates the group to set the new values for minimum, maximum, and desired sizes, as specified by your scaling action.

You can create scheduled actions for scaling one time only or for scaling on a recurring schedule.

Considerations for Scheduled Actions

When you create a scheduled action, keep the following in mind.

  • Auto Scaling guarantees the order of execution for scheduled actions within the same group, but not for scheduled actions across groups.

  • A scheduled action generally executes within seconds. However, the action may be delayed for up to two minutes from the scheduled start time. Because Auto Scaling executes actions within an Auto Scaling group in the order they are specified, scheduled actions with scheduled start times close to each other may take longer to execute.

  • You can create a maximum of 125 scheduled actions per Auto Scaling group.

  • A scheduled action must have a unique time value. If you attempt to schedule an activity at a time when another existing activity is already scheduled, the call is rejected with an error message noting the conflict.

  • Cooldown periods are not supported.

Create a Scheduled Action Using the Console

Complete the following procedure to create a scheduled action to scale your Auto Scaling group.

To create a scheduled action

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. On the navigation pane, under Auto Scaling, choose Auto Scaling Groups.

  3. Select your Auto Scaling group.

  4. On the Scheduled Actions tab, choose Create Scheduled Action.

  5. On the Create Scheduled Action page, do the following:

    1. Specify the size of the group using at least one of Min, Max, and Desired Capacity.

    2. Select an option from Recurrence. If you select Once, Auto Scaling performs the action at the specified time. If you select Cron, enter a Cron expression that specifies when Auto Scaling performs the action, in UTC.

    3. Specify the start and end time using Start Time and End Time.

    4. Choose Create.

Update a Scheduled Action

If your requirements change, you can update a scheduled action.

To update a scheduled action

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. On the navigation pane, under Auto Scaling, choose Auto Scaling Groups.

  3. Select your Auto Scaling group.

  4. On the Scheduled Actions tab, select the scheduled action.

  5. Choose Actions, Edit.

  6. On the Edit Scheduled Action page, do the following:

    1. Update the size of the group as needed using Min, Max, or Desired Capacity.

    2. Update the specified recurrence as needed.

    3. Update the start and end time as needed.

    4. Choose Save.

Create or Update a Scheduled Action Using the AWS CLI

You can create a schedule for scaling one time only or for scaling on a recurring schedule.

To schedule scaling for one time only

To increase the number of running instances in your Auto Scaling group at a specific time, in "YYYY-MM-DDThh:mm:ssZ" format in UTC, use the following put-scheduled-update-group-action command:

aws autoscaling put-scheduled-update-group-action --scheduled-action-name ScaleUp --auto-scaling-group-name my-asg --start-time "2013-05-12T08:00:00Z" --desired-capacity 3 

To decrease the number of running instances in your Auto Scaling group at a specific time, in "YYYY-MM-DDThh:mm:ssZ" format in UTC, use the following put-scheduled-update-group-action command:

aws autoscaling put-scheduled-update-group-action --scheduled-action-name ScaleDown --auto-scaling-group-name my-asg --start-time "2013-05-13T08:00:00Z" --desired-capacity 1 

To schedule scaling on a recurring schedule

You can specify a recurrence schedule, in UTC, using the Cron format. For more information, see the Cron Wikipedia entry.

Use the following put-scheduled-update-group-action command to create a scheduled action that runs at 00:30 hours on the first of January, June, and December each year:

aws autoscaling put-scheduled-update-group-action --scheduled-action-name scaleup-schedule-year --auto-scaling-group-name my-asg --recurrence "30 0 1 1,6,12 0" --desired-capacity 3 

Delete a Scheduled Action

When you are finished with a scheduled action, you can delete it.

To delete a scheduled action using the console

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. On the navigation pane, under Auto Scaling, choose Auto Scaling Groups.

  3. Select your Auto Scaling group.

  4. On the Scheduled Actions tab, select the scheduled action.

  5. Choose Actions, Delete.

  6. When prompted for confirmation, choose Yes, Delete.

To delete a scheduled action using the AWS CLI

Use the following delete-scheduled-action command:

aws autoscaling delete-scheduled-action --scheduled-action-name ScaleUp