Overview of Autoscaling in AWS
Autoscaling, also spelled as auto-scaling or sometimes automatic-scaling is a technique in cloud computing, where the amount of resources required for a server farm to work efficiently, typically measured as the number of active servers scales up or scale down when required based on the load on the whole server farm. We can closely relate this to load balancing. Typically autoscaling is a kind of automation for a manual process. Let’s take a scenario where you have an e-commerce website which is running and serving customers efficiently, none of your customer complaining about site delay nor you is losing users because of site performance. As the business was growing you did marketing and people got more aware of your website day by day the traffic on the website was getting increased. On one side you were happy to see the increase in business but you need to also see that website should serve every customer and not lag. Let’s say currently it can serve 100 customers at a time means if 100 users logged into your site then all can navigate smoothly and purchase, and this all is running over some fixed configuration of suppose t2.micro instance of AWS. Now as a website is getting popular you expect around 250 – 300 users at a time, clearly you need 2 more servers where you can divide the traffic and then everybody can navigate properly.
The manual work which is to calculate how much resources you would require to serve your customers and scaling the system based on the load over your server farm and dividing the traffic is done manually for the above scenario. We can say this is actually a scaling but not autoscaling because it was done manually but you can use the service of AutoScaling with a load balancer in AWS which will automate the above task and that’s what you call Autoscaling or automatic-scaling in terms of cloud computing.
How does Autoscaling work in AWS?
In AWS there are multiple entities involved in the process of Autoscaling, which is:- Load Balancer and AMIs are two main components involved in this process. First, you need to create AMI of your current server, in simpler terms we can say a template of your current configuration consists of all the system setting and current website. This you can do in the AMI section of AWS. If we go according to our above scenario and you have configured autoscaling so your system is prepared for the future traffic.
When the traffic would start increasing the AWS autoscaling service would automatically initiate the launch of another instance with the same configuration of your current server with the help of AMI of your server.
Then comes the next part where we need to divide or route our traffic equally among the instances which are newly launched this would be taken care of by the load balancer in AWS. Load balancer divide the traffic based on the load over a particular system, they do some internal process to decide where to route the traffic.
The creation of a new instance solely depends on a set of rules defined by the user who is configuring autoscaling. The rules can be as simple as CPU utilization for example, you can configure autoscaling when your CPU utilization reaches 70 -80 % then you want to launch a new instance to handle the traffic. There can be rules to scale down also.
4.5 (1,895 ratings)
Autoscaling components in AWS
There are many components involved in the process of autoscaling, some of them we already named before like AMI, Load balancers and there are some others as well.
Components involved in Autoscaling:-
- AMI (Amazon Machine Image)
- Load Balancer
- EC2 Instance
- Autoscaling groups
There can be more components but you can say most of the components which can be scaled can be part of Autoscaling.
An AMI is an executable image of your EC2 Instance which you can use to create new instances. For scaling your resources you need your new server to have all the configuration of your websites and ready to launch. In AWS you can achieve this by AMI’s which is nothing but an identical executable image of a system that you can use to create new images and the same would be used by AWS in case of autoscaling to launch new instances.
2. Load Balancer
Creating instance is just one part of autoscaling you also needs to divide your traffic among the new instances and that work is handled by the Load Balancer. A load balancer can automatically identify the traffic over the systems to which it’s connected and can redirect the requests on the basis of rules or in classic way to the instance with less load. The process of dividing the traffic among the instances we call it load balancing. Load balancers are used to increase the reliability of an application and efficiency to handle concurrent users.
A load balancer places a very important role in autoscaling. Typically load balancers can be of two types:-
- Classic Load Balancer.
- Application Load Balancer.
Classic Load Balancer: – Classic load balancer follows a very simple approach it will just distribute the traffic equally to all the instances. It’s very basic and nowadays nobody uses a classic load balancer. It could be a good choice for a simple static html page website but in current scenarios, there are hybrid apps, or multi-components and high computation applications which has numerous components dedicated to a particular work.
Application Load Balancer
- The most widely used type of load balancer where the traffic is redirected on the basis of certain simple or complex rules that can be based on “path” or “host” or as user-defined.
- It would be better if we take a scenario of a document processing application.
- Let’s say you have an application based on microservice architecture or monolithic and the path “/document” is specific to a document processing service and other paths “/reports” which just shows the reports of the documents get processed and stats about processed data. We can have an autoscaling group for one server which is responsible to process the documents and another only to show the reports.
- In application load balancer you can configure and set rule according to a path that if the path matches “/document” then redirects to an autoscale group for server 1 or if it matches with path “/reports” then redirect it to an autoscale group for server 2. Internally one group can have multiple instances and the load will be distributed in classical form means equally among the instances.
The copy of the data you have in your hard drive is typically an image of your storage. The typical difference between snapshot and AMI is an executable image that can be used to create a new instance but snapshot is just a copy of the data you have in your instance. If you have an incremental snapshot of your EC2 instance then snapshot would be a copy of those blocks that are modified since the previous snapshot.
4. EC2 (Elastic Compute Cloud) Instance
An EC2 instance is a virtual server in Amazon’s Elastic Compute Cloud (EC2) which is used to deploy your applications on Amazon Web Services (AWS) infrastructure. EC2 service allows you to connect to a virtual server with an authenticate key via SSH connection and allows you to install different components of your application along with your application.
5. Autoscaling group
It is a group of EC2 instances and the core of Amazon EC2 AutoScaling. When you create an AutoScaling group, you have to give information about the subnets and an initial number of instances you want to start with.
From the above content, we got a good idea of what autoscaling is and how important it is in today’s world.
- If we see technology and user demands are increasing day by day and also their expectations of the fast and efficient application.
- A great application is fast, gives you good user experience and does the stuff for which it’s built and to achieve this you need a very robust backend and technology stack.
- After you are in business and it’s a hit your user base is very likely to increase and there will be situations to handle concurrent users that time you need autoscaling to scale up and scale down according to situations to give your users a seamless experience.
From my point of view, scaling is a very important aspect in today’s world and today or tomorrow we need to do this so, go with AWS autoscaling and scale up your products.
This is a guide to What is AutoScaling in AWS? Here we have discuss its definition, working and different components of autoscaling in AWS. You may also look at the following article to learn more –