Let me explain - Auto scaling and its components

Let me explain - Auto scaling and its components

·

5 min read

AWS AutoScaling is an advanced cloud computing feature that provides automatic resource management based on server load. A server cluster's resources typically scale up and scale down dynamically via mechanisms such as a load balancer, AutoScaling groups, Amazon Machine Image (AMI), EC2 Instances, and Snapshots. The AWS AutoScaling feature assists businesses in managing their pick-time load. Furthermore, it optimizes performance and cost based on on-demand needs. AWS allows you to configure a threshold value for CPU utilization and any resource utilization level; once that threshold is reached, the AWS cloud computes engine automatically enables and provision for scaling up the resources. Similarly, if the load falls below the threshold, it automatically scales down to the default configuration level.

How does Autoscaling work in AWS?

There are multiple entities involved in the Autoscaling process in AWS, which are: Load Balancer and AMIs are two main components involved in this process. To begin, you must create an AMI of your current server; in simpler terms, an AMI of your current configuration consists of all system settings as well as the current website. This is possible in AWS's AMI section. If we follow our above scenario and configure autoscaling, your system will be ready for future traffic.

When traffic begins to increase, the AWS autoscaling service will automatically launch another instance with the same configuration as your current server using your server's AMI.

The next step is to divide or route our traffic equally among the newly launched instances; the load balancer in AWS will handle this. A load balancer divides traffic based on the load on a specific system; they use internal processes to determine where to route traffic.

A new instance is created solely based on a set of rules defined by the user configuring autoscaling. The rules can be as simple as CPU utilization; for example, you can configure autoscaling to launch a new instance when your CPU utilization reaches 70-80%. Of course, there can be rules for scaling down.

Autoscaling Components in AWS

There are numerous components involved in the autoscaling process, some of which we have already mentioned, such as AMI and load balancers, as well as others.

Components involved in Autoscaling:

  • AMI (Amazon Machine Image)

  • Load Balancer

  • Snapshot

  • EC2 Instance

  • Autoscaling groups

There may be additional components, but most of the components that can be scaled are included in Autoscaling.

1. AMI

An AMI is a downloadable executable image of your EC2 instance that you can use to launch new instances. To scale your resources, your new server must have all of your websites configured and ready to go. In AWS, you can accomplish this through AMIs, which are nothing more than identical executable images of a system that you can use to create new images, and AWS will use the same in the case of autoscaling to launch new instances.

2. Load Balancer

Creating an instance is only one part of autoscaling; you must also divide your traffic among the new instances, which is handled by the Load Balancer. A load balancer can automatically identify traffic over the systems to which it is connected and redirect requests based on rules or in the traditional manner to the instance with the least load. Load balancing is the process of distributing traffic among instances. Load balancers are used to improve an application's reliability and efficiency in handling concurrent users.

A load balancer is extremely important in autoscaling. Load balancers are typically classified into two types.:-

  • Classic Load Balancer

    A traditional load balancer takes a very simple approach: it simply distributes traffic evenly among all instances. It's very simple, and nobody uses a traditional load balancer anymore. It could be a good choice for a simple static HTML page website, but in today's scenarios, there are hybrid apps or multi-component and high computation applications that have numerous components dedicated to a specific task.

  • Application Load Balancer

    The most common type of load balancer, in which traffic is redirected based on simple or complex rules that can be based on "path" or "host" or as user-defined.

Consider the following scenario: a document processing application.

Assume you have a monolithic or microservice architecture application, and the path "/document" is specific to a document processing service, and other paths "/reports" simply show the reports of the documents that have been processed and statistics about processed data. We can have an autoscaling group for one server that handles document processing and another that only displays reports.

In the application load balancer, you can configure and set a rule based on a path that redirects to an autoscale group for server 1 if the path matches "/document," or to an autoscale group for server 2 if the path matches "/reports." Internally, one group can have multiple instances, and the load will be distributed equally among the instances in the classical form.

3. Snapshot

The copy of data on your hard drive is usually an image of your storage. The primary distinction between a snapshot and an AMI is that an AMI is an executable image that can be used to create a new instance, whereas a snapshot is simply a copy of the data in your instance. If you have an incremental snapshot of your EC2 instance, a snapshot is a copy of the blocks that have changed since the last snapshot.

4. EC2 (Elastic Compute Cloud) Instance

An Elastic Compute Cloud (EC2) instance is a virtual server in Amazon's Elastic Compute Cloud (EC2) that is used to deploy your applications on Amazon Web Services (AWS) infrastructure. The EC2 service allows you to connect to a virtual server with an authenticated key via SSH and install various components of your application alongside your application.

5. Autoscaling group

It is a collection of EC2 instances that serves as the foundation of Amazon EC2 AutoScaling. When you create an AutoScaling group, you must specify the subnets and the number of instances you want to start with.