Types of AWS Auto Scaling

Amerie
6 min readDec 29, 2022

--

Hey there! Are you using the public cloud? If so, you should be familiar with the feature of Auto Scaling.

Today, let me introduce you to the different types of AWS Auto Scaling and when and how to use each one.

What is AutoScaling?

AWS Auto Scaling keeps your applications running smoothly by automatically adjusting capacity to maintain consistent performance while minimizing costs. With AWS Auto Scaling, you can quickly set up scaling for multiple resources across different services in just a matter of minutes.

But when should you use this feature? Let’s discuss two common scenarios.

  1. Game Company (Unstable traffic)

As an IT engineer in charge of the live environment for your product, you’re faced with a challenge. With the release of a new game next month, there’s uncertainty around the expected traffic levels.

What if you set up 10 EC2 instances, but the player count exceeds your predictions? You need a solution that can handle fluctuations in demand. That’s where AWS Auto Scaling comes in.

This feature makes it easy to adjust your infrastructure to accommodate changing traffic levels, ensuring stable, predictable performance and cost efficiency.

FOR REFERENCE ONLY

4 types of AWS Autoscaling

  • Target tracking scaling
  • Step Scaling
  • Simple Scaling
  • Scheduled Scaling

Target tracking scaling:

With Target Tracking Scaling, you can easily maintain a desired average level of utilization or throughput for your application by specifying a target value based on an Amazon CloudWatch metric. EC2 Auto Scaling will automatically adjust the number of instances in your group to handle increased traffic during peak times and reduce instances during periods of low utilization or throughput, helping to lower costs.

For instance, let’s say your application currently runs on two instances and you want the average CPU utilization of your Auto Scaling group to stay around 50% as the load on the application changes. This way, you can handle traffic spikes without having too many idle resources. You can achieve this by creating a Target Tracking Scaling policy that targets an average CPU utilization of 50%. The Auto Scaling group will then scale the number of instances to keep the actual metric value close to or at 50%.

Also, you can choose another metric type as below:

Step Scaling:

In addition to target tracking scaling, you can also use step scaling to handle sudden spikes in demand for your application. Step scaling allows you to add instances incrementally, based on cumulative metrics like average CPU utilization.

For instance, if the average CPU utilization exceeds 50%, you can add 3 instances. And if it goes beyond 60%, you can add 4 more instances. To trigger this process, you can set up a CloudWatch Alarm to send an alert when the average CPU utilization hits a specific threshold, like 50%.

When creating a step scaling policy, it's important to specify a range of values that correspond to each step in the scaling process. This helps ensure that your instances are added in a controlled and effective manner, to meet the changing demands of your application.

Simple Scaling:

With step scaling policies and simple scaling policies, you have the ability to increase or decrease the current capacity of your group based on a single scaling adjustment, with a required cooldown period between each scaling activity.

Both step scaling policies and simple scaling policies require the creation of CloudWatch alarms and the specification of high and low thresholds.

However, step scaling policies are considered a better choice due to their ability to respond to additional alarms without having to wait for the completion of the scaling activity or health check replacement and the end of the cooldown period. This is because cooldown periods help ensure that the effects of previous scaling activities are visible before initiating additional ones.

In conclusion, it is possible to use both the Target tracking and Step scaling policies together.

In the event that both policies trigger a scaling activity at the same time, the one with the higher instance increase will take precedence. For instance, if both policies indicate an increase of one instance from target tracking and two instances from step scaling, the group will increase by two instances.

When scaling down, the policy with more instances will also be prioritized to avoid potential issues. For instance, if both policies indicate a decrease of one instance from target tracking and two instances from step scaling, the group will decrease by one instance.

Tip: Consider incorporating Auto Scaling with a Load Balancer to effectively distribute traffic and ensure reliability. Additionally, consider utilizing multiple Availability Zones to increase the resilience of your Auto Scaling instances.

2. Online Shopping mall (Predictable traffic)

As an IT infrastructure engineer for your company’s online shopping mall, you play a critical role in ensuring seamless operation during peak periods, such as the upcoming Black Friday sales season.

With a projected three-fold increase in website traffic, it is imperative that you take proactive measures to prevent downtime and ensure a positive user experience.

Auto-scaling scheduled is a powerful tool that can help you achieve this goal by automatically creating additional instances in anticipation of the increased demand. This can help ensure that your customers are able to access the website and complete their purchases without any interruptions, making the most of the lucrative sales period.

FOR REFERENCE ONLY

Scheduled Scaling:

Scheduled scaling allows you to plan and manage capacity changes in advance to meet predictable load changes. To implement scheduled scaling, you create scheduled actions. These actions are effective for traffic patterns that are predictable or for proactive capacity planning to ensure sufficient instances are available before demand spikes.

When creating a scheduled action, you must specify the desired, minimum, and maximum capacity, start date, and time for the scaling event. If you have recurring patterns, you can add policies that repeat at specified intervals, and also set a schedule for deleting the policies. Scheduled actions can be one-time only or set on a recurring schedule.

By combining multiple scheduled actions, you can also implement dynamic scaling policies. For example, if you manage an online shopping mall, you can create a scheduled action to increase the group size during the busy season and then dynamically adjust the desired capacity based on traffic with a dynamic scaling policy.

--

--

Amerie

Partner Engineer at Google | Solutions Architect | Cloud Engineer | AWS & GCP Certified