Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Increase Efficiency with Auto Scaling

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe the features of Amazon EC2 Auto Scaling.
  • Describe the benefits of Amazon EC2 Auto Scaling.
  • Differentiate between Amazon EC2 Auto Scaling and AWS Application Auto Scaling.

Imagine you have an application that enables employees to search for conference rooms. 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 demand on the application increases significantly.

In a traditional data center, you need to anticipate periods of heavy use and have enough physical servers to handle the anticipated peak load. However, this means that during periods of minimal use, the servers will sit idle in the data center.

Graph of demand and capacity throughout the week. Demand increases and peaks on Wednesday and then drops off; capacity is high enough to meet demand and goes unused when demand is low.

Know the Importance of Scale

Scaling is the ability to increase or decrease the compute capacity of your application. To understand why scaling is important, compare the above example to this model.

Rather than working with physical servers, a company has built its application in the cloud. The company experiences the same traffic in which resources are most needed on Wednesdays, and least needed on Sundays. The application is able to add and remove servers on-demand. The company pays only for what it uses, making its application more cost-effective.

Graph of demand and capacity throughout the week. Demand increases and peaks on Wednesday and then drops off. Capacity increases and decreases to match demand.

In the AWS Cloud, Amazon EC2 Auto Scaling allows you to automatically provision EC2 instances when demand spikes and terminate them when they’re no longer needed. Because Amazon EC2 Auto Scaling uses EC2 instances, you pay for only the instances that you use when you use them. You now have a cost-effective architecture that provides the best customer experience while reducing expenses.

Get to Know Amazon EC2 Auto Scaling

Amazon EC2 Auto Scaling icon depicting a computer chip with horizontal arrows pointing toward it and vertical arrows pointing away from it, representing the ability to scale in or out

Amazon EC2 Auto Scaling monitors your applications and automatically adjusts capacity to maintain steady, predictable performance at the lowest possible cost.

Provision Amazon EC2 Capacity Through Fleet Management

If your application runs on Amazon EC2 instances, you have what is called a fleet of EC2 instances. Amazon EC2 Auto Scaling fleet management ensures that your application is able to receive traffic and that the instances are working properly. When Amazon EC2 Auto Scaling detects a failed health check, it can replace the instance automatically.

Dictate Your Capacity with Auto Scaling Groups

With Amazon EC2 Auto Scaling, you can create collections of EC2 instances called Auto Scaling groups. You can specify the minimum, maximum, and desired number of EC2 instances in a group. Amazon EC2 Auto Scaling then ensures that your group will never go below or above the sizes that you have specified.

The group can then be treated as a single unit for you to manage.

Auto Scaling group set up for one minimum, two desired, and four maximum EC2 instances. Two instances are currently provisioned, and there are placeholders for two additional instances to meet the maximum of four.

Amazon EC2 Auto Scaling Options

Amazon EC2 Auto Scaling provides several ways to scale your Auto Scaling group.

Scaling Option
Behavior
Maintain the current instance levels at all times
Amazon EC2 Auto Scaling performs a periodic health check on running instances within the Auto Scaling group. If it finds an unhealthy instance, it terminates that instance and launches a new one.
Manual scaling
You manually change the maximum, minimum, or desired capacity, and Amazon EC2 Auto Scaling creates or terminates instances to maintain the updated capacity.
Scheduled scaling
Scaling actions are performed automatically based on a time and date you set.
Dynamic scaling
Using scaling policies, you define parameters that control the scaling process in response to changing conditions.
Predictive scaling
AWS uses machine learning algorithms and dynamic scaling to adjust capacity based on trends and forecasts.

Control Resources with Dynamic Scaling

The dynamic scaling capabilities of Amazon EC2 Auto Scaling automatically increase or decrease capacity based on load or other metrics that you specify. For example, if your CPU utilization spikes above 80% and you have an alarm set up, Amazon EC2 Auto Scaling can add a new instance dynamically. You can also set a condition to remove instances in the same increments when CPU utilization is low.

Amazon EC2 Auto Scaling group with maximum instances set to 10 and minimum set to 2. Low demand shows 2 instances provisioned, while high demand shows 10 instances.

Get More Efficiency with AWS Application Auto Scaling

AWS Application Auto Scaling icon depicting a puzzle piece with horizontal arrows pointing toward it and vertical arrows pointing away, against an orange background

AWS Application Auto Scaling is a separate service that provides application scaling across multiple AWS services, such as:

  • Amazon EC2 Spot Fleets
  • Amazon Elastic Container Service tasks
  • Amazon DynamoDB tables and indexes
  • Amazon Aurora read replicas

The Application Auto Scaling interface provides recommendations for how to optimize performance, costs, or balance between them. With AWS Application Auto Scaling, your applications have the right resources at the right time.

Both EC2 Auto Scaling and Application Auto Scaling are available at no additional charge. You pay only for the AWS resources needed to run your applications and any CloudWatch monitoring fees. You will learn more about Amazon CloudWatch in a later unit.

The next unit explores Elastic Load Balancing.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback