AWS Auto Scaling — Why, What & How

Ujjwal Khabrani
7 min readMar 1, 2021
AWS Auto Scaling — Why, What and How
AWS Auto Scaling — Why, What, and How

Maintaining the availability of a website or application can be a tedious task in today’s world as predicting a number of visitors at a certain time is not easy. To make it easy AWS comes up with its auto-scaling services which helps you to scale up and down easily.

In this blog, you are going to have a deep insight into what, when, and how AWS Auto scaling can be used. The topics that we are going to cover in this blog are:

  • Why AWS Auto Scaling
  • What is AWS Auto Scaling
  • Benefits of AWS Auto Scaling
  • Different Scaling Plans
  • How AWS Auto Scaling Works
  • Why AWS Auto Scaling?

AWS auto-scaling helps you optimize and utilize the resources in a cost-efficient manner. When consuming AWS services you need to only pay for the resources you actually need. When demand drops, it will automatically remove any excess resource capacity so you avoid overspending and when demand rises it enables or scales up the resources to meet the demand.

  • What is AWS Auto Scaling?

AWS Auto Scaling allows you to build scaling plans using which you can automate how groups of different resources will respond when there is a change in demand or traffic. You can optimize availability, costs, or a balance of both. It will automatically manage all the scaling needs based on the preferences you have set.

  • Benefits of AWS Auto Scaling

1. Better fault tolerance: Amazon Auto Scaling can detect when an instance is unhealthy, terminate it, and launch an instance to replace it. You can configure your instances to uses multiple availability zones, so that if one zone is unavailable then another instance will be launched automatically by AWS to meet the demand.

2. Better availability: Amazon Auto Scaling helps ensure that your application always has the right amount of capacity to handle the current traffic demand.

3. Better cost management: Amazon Auto Scaling can dynamically increase and decrease capacity based on the demand and as you pay only for the instances that you use, you save money by launching instances when they are needed and terminating them when they aren’t.

  • Different Scaling Plans

Scaling plans helps define when and how to scale. Amazon auto-scaling provides several ways for you to scale the auto-scaling group.

1 Maintaining Current instance-level at all time: You can configure and maintain a specified number of running instances at all the time in the auto-scaling group. To achieve this auto-scaling performs a periodic check on running instances within an auto-scaling group. If any unhealthy instance is found, auto-scaling terminates that instance and launches new instances to switch it.

2 Manual Scaling: In this, you specify solely the changes in maximum, minimum, or desired capacity of your auto-scaling groups and then Auto-scaling maintains the resources or instances with the updated capacity.

3 Scale based on Schedule: In some situations, you can predict exactly when your application will have high traffic. For example: In cases like sales on the website, you can predict the number of visitors is going to increase for a specific time so you can schedule auto-scaling to perform scaling action based on that time.

4 Scale based on demand: This is the most advanced scaling model, resources scales by using a scaling policy. In this, you can define specific parameters to scale in and scale out your resources. For example, you can define a parameter like if CPU utilization crosses the set threshold limit then a new instance will be launched. You should specify two scaling policies, one for scaling In and one for scaling out.

  • How does AWS Auto Scaling work?

Now we will look into how AWS Auto-scaling works. For it, we have to configure a single unified scaling policy per application source. From that application policy we can explore the applications also and then we have to select the service that we want to scale. Also for the optimization, we have to select from the two given options i.e., cost and performance. We have to select the most relevant option that we want to optimize. After this, we have to keep track of the scaling. Now we will go to the AWS console and look at the step-by-step process for scaling an EC2 instance.

AWS Auto Scaling

Step 1: Firstly you have to log in to your AWS console. Then click on EC2 service. On the bottom left corner, you will find Auto-scaling. In this firstly we have to click launch configuration and then we will create the auto-scaling groups. So click on launch configuration. A dashboard like given below will appear. Then click on Create launch configuration.

Step 2: In this step, we have to choose AMI(Amazon machine image). Here I have selected Amazon Linux 2 AMI.

Step 3: In this step, we have to select the type of server. I have selected t2 micro. Then click on next.

Step 4: Now put a name to your launch configuration. And I have kept the rest of the thing as a default. Then click on next.

Step 5: In this step, we have to add storage. I am going with default 8 GB storage and click on next.

Step 6: In this step, you have to configure security groups. For it, we have two options, one we can create new, and the other we can select from an existing group. I have created a new group with default settings. Then click on Review.

Step 7: After reviewing carefully all the configurations click on create a launch configuration. Then it will ask you to select a key pair. You can select from an existing key pair or create a new one also. I already have a key pair so I'm selecting that and then checkmark the given box and click on the launch configuration button.

Step 8: On this step, you can see you have successfully launched the configuration of an auto-scaling and now the next thing is to create an auto-scaling group. So click on create an Auto Scaling group using this launch configuration.

Step 9: Enter the Group name of your choice as I have entered ‘Test’ and group size means the minimum number of instances that you want to keep up and running every time. Keep network to default and in the subnet field, you have to select availability zones. As on scaling the instances will be launched in those zones respectively. Click on next.

Step 10: Now you have to configure scaling policies. Here I am scaling from 1–4 instances and for it, I have set metric-type as ‘average CPU utilization. which means whenever a CPU usage will cross my set threshold limit or target value a new CPU will be launched. Click on next.

Step 11: Here you can add notifications. It will help you to notify whenever there is a scale-out or scale in action is performed. For now, I am not adding any notification as it requires us to enable SNS(simple notification service). Click on next.

Step 12: It is an optional step in which it asks to mention tags. Basically tags helps us to identify the instances. I will keep it blank and click on review.

Step 13: Review all the set scaling policies and click on create auto-scaling groups.

Step 14: Your auto-scaling group is also launched. Now you can click on close.

Step 15: Here you can see the auto-scaling is successfully configured and all the details set are shown on the screen.

  • Case Study

Before concluding, I did a case study on how EXTRAMARKS achieves 15% ROI by using auto-scaling. Below is the link for the same.

https://ukhabrani.medium.com/case-study-on-extramarks-achieves-15-roi-by-using-aws-auto-scaling-1b008f30d802

  • Conclusion

AWS Auto Scaling is a very useful future launched by AWS that helps you monitor your applications and automatically scale based on the demand hence saving cost and performance. The service provides a simple, powerful user interface that lets you build scaling plans for your resources. And it comes with no extra cost, You pay only for the AWS resources needed to run your applications and Amazon CloudWatch monitoring fees.

--

--