Auto Scaling
Developer Guide (API Version 2011-01-01)
Did this page help you?  Yes | No |  Tell us about it...
Next »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.

What Is Auto Scaling?

Auto Scaling is an AWS service that allows you to increase or decrease the number of EC2 instances within your application's architecture. With Auto Scaling, you create collections of EC2 instances, called Auto Scaling groups. You can specify the minimum and maximum number of instances in each Auto Scaling group. Each Auto Scaling group can contain one or more scaling policies—these policies define when Auto Scaling launches or terminates EC2 instances within the group.

An illustration of a basic Auto Scaling group.

You can create as many Auto Scaling groups as you need. For example, if an application consists of a web tier and an application tier, you can create two Auto Scaling groups—one for each tier.

Adding Auto Scaling to your network architecture is one way to maximize the benefits of the AWS cloud. With Auto Scaling, you can make your applications:

  • More fault tolerant. Auto Scaling can detect when an instance is unhealthy, terminate it, and launch a new instance to replace it.

  • More highly available. You can configure Auto Scaling to use multiple subnets or Availability Zones. If one subnet or Availability Zone becomes unavailable, Auto Scaling can launch instances in another one to compensate.

  • Increase and decrease in capacity only when needed. Unlike on-premises solutions, with Auto Scaling you can have your network scale dynamically. You also don't pay for Auto Scaling. Instead, you pay only for the EC2 instances launched, and only for as long as you use them.

Auto Scaling Benefits: An Example

To better demonstrate some of the benefits of Auto Scaling, consider a basic Web application running on AWS. This application allows employees to search for conference rooms that they might want to use for meetings. During the beginning and end of the week, usage of this application is minimal. During the middle of the week, more employees are scheduling meetings, so the demands on the application increases significantly.

The following graph shows how much of the application's capacity is used over the course of a week.

An example of the capacity demand on an application.

Traditionally, there are two ways to plan for these changes in capacity. The first option is to add enough servers so that the application always has enough capacity to meet demand. The downside of this option, however, is that there are days in which the application doesn't need this much capacity. The extra capacity remains unused and, in essence, raises the cost of keeping the application running.

An example showing how buying more capacity than needed can be inefficient from a cost perspective.

The second option is to have enough capacity to handle the average demands on the application. This option is less expensive, because you aren't purchasing equipment that you'll only use occasionally. However, you risk creating a poor customer experience when the demands on the application exceeds its capacity.

An example showing how buying less capacity than needed can cause a poor customer experience.

By adding Auto Scaling to this application, you have a third option available. You can add new instances to the application only when necessary, and terminate them when they're no longer needed. And because Auto Scaling uses EC2 instances, you only have to pay for the instances you use, when you use them. You now have a cost-effective architecture that provides the best customer experience while minimizing expenses.

An example showing how Auto Scaling can adjust capacity as needed.

Getting Started

If you're new to Auto Scaling, we recommend that you review How Auto Scaling Works and Auto Scaling Group Lifecycle before you begin.

To begin, complete the Getting Started with Auto Scaling tutorial to create an Auto Scaling group and see how it responds when an instance in that group terminates. If you already have instances running in AWS, you can create an Auto Scaling group using an existing EC2 instance, and remove the instance from the group at any time. After you are familiar with how Auto Scaling works, read Planning Your Auto Scaling Group to learn how to make the most of Auto Scaling.

Accessing Auto Scaling

AWS provides a web-based user interface, the AWS Management Console. If you've signed up for an AWS account, you can access Auto Scaling by signing into the AWS Management Console. To get started, select EC2 from the console home page, and then select Launch Configurations from the navigation pane.

If you prefer to use a command line interface, you have several options:

AWS Command Line Interface (CLI)

Provides commands for a broad set of AWS products, and is supported on Windows, Mac, and Linux. To get started, see AWS Command Line Interface User Guide. For more information about the commands for Auto Scaling, see autoscaling in the AWS Command Line Interface Reference.

Auto Scaling Command Line Interface (CLI) Tools

Provides commands for Auto Scaling, and is supported on Windows, Mac, and Linux. To get started, see Auto Scaling Command Line Interface (CLI).

AWS Tools for Windows PowerShell

Provides commands for a broad set of AWS products for those who script in the PowerShell environment. To get started, see the AWS Tools for Windows PowerShell User Guide. For more information about the cmdlets for Auto Scaling, see the AWS Tools for Windows PowerShell Reference.

Auto Scaling provides a Query API. These requests are HTTP or HTTPS requests that use the HTTP verbs GET or POST and a Query parameter named Action. For more information about the API actions for Amazon EC2, see Actions in the Amazon EC2 API Reference.

If you prefer to build applications using language-specific APIs instead of submitting a request over HTTP or HTTPS, AWS provides libraries, sample code, tutorials, and other resources for software developers. These libraries provide basic functions that automate tasks such as cryptographically signing your requests, retrying requests, and handling error responses, making it is easier for you to get started. For more information, see AWS SDKs and Tools.

For information about your credentials for accessing AWS, see AWS Security Credentials in the Amazon Web Services General Reference.

Pricing for Auto Scaling

There are no additional fees with Auto Scaling, so it's easy to try it out and see how it can benefit your AWS architecture.

To automatically distribute incoming application traffic across multiple instances in your Auto Scaling group, use Elastic Load Balancing. For more information, see Elastic Load Balancing Developer Guide.

To monitor basic statistics for your instances and Amazon EBS volumes, use Amazon CloudWatch. For more information, see the Amazon CloudWatch Developer Guide.

To monitor the calls made to the Auto Scaling API for your account, including calls made by the AWS Management Console, command line tools, and other services, use AWS CloudTrail. For more information, see the AWS CloudTrail User Guide.