Auto Scaling
Last updated
Last updated
Amazon EC2 Auto Scaling helps you ensure that you have the correct number of Amazon EC2 instances available to handle the load for your application.
AWS Auto-Scaling is a mechanism that automatically permits you to increase or decrease your resources to meet demand based on custom-defined metrics and thresholds.
Through Auto-scaling, it’s simple to set up application scaling for multiple resources across multiple services in minutes.
Benefits
Setup Scaling Quickly
Make Smart Scaling Decisions
Automatically Maintain Performance
Pay Only For What You Need
Auto-Scaling Workflow
AWS autoscaling will scale the application based on the load of application. Instead of scaling manually AWS auto scaling will scale the application automatically when the incoming traffic is high it will scale up the application and when the traffic is low it will scale down the application.
An Auto Scaling group contains a collection of EC2 instances that are treated as a logical grouping for the purposes of automatic scaling and management.
Application Auto-Scaling is a web service for developers and system administrators who need a solution for consequently scaling their scalable resources for individual AWS services past Amazon EC2.
It enables us to configure automatic scaling for the subsequent resources:
Amazon ECS services
Spot Fleet requests
Amazon EMR clusters
AppStream 2.0 fleets
DynamoDB tables and global secondary indexes
Aurora replicas
Amazon SageMaker endpoint variants
Custom resources provided by your applications
Target tracking scaling: Increase or decrease the present capacity of the group based on a target value for a selected metric.
Step scaling: Increase or decrease the present capacity of the group based on a set of scaling adjustments, known as step adjustments, that change based on the size of the alarm breach.
Simple scaling: Increase or decrease the present capacity of the group based on a single scaling adjustment.
Launch Configuration is an instance configuration template used by the Auto-Scaling group to launch Amazon EC2 instances.
A launch configuration is similar to an EC2 configuration and involves the selection of the Amazon Machine Image (AMI), the instance type, a key pair, one or more security groups, and a block device mapping.
Launch configurations are often related to multiple Auto-Scaling groups.
Launch configuration can’t be modified after creation.
Basic or detailed monitoring for the instances within the Auto-Scaling group is often enabled when a launch configuration is created.
Basic monitoring is enabled by default when you create the launch configuration utilizing the AWS Management Console, and detailed monitoring is permitted when you create the launch configuration using the AWS CLI or an API.
A Launch Template identical to a launch configuration, with additional features.
Launch Template allows multiple versions of a template to be defined.
With versioning, a subset of the complete set of parameters is often created and then reused to create other templates or template versions.
Launch Template enables the selection of both Spot and On-Demand Instances or multiple instance types.
Launch templates support EC2 Dedicated Hosts. Dedicated Hosts are physical servers with EC2 instance capacity that are dedicated to your use.
Click on the All Services.
Click on the EC2(Elastic Cloud Computing).
Scroll Down and click on the Launch Templates and click on the Create launch template
Type the Template name.
Select the Amazon Machine Image.
Select the Instance Type and Key pair.
Select the Security Group or Create the new one.
Click on the Create Launch Template.
Now you can see the template is created. Now, scroll down and click on the Auto Scaling Groups.
Click on the Create Auto Scaling group.
Type the Auto Scaling group name.
Select your Template.
Select the VPC or go with the default VPC and also select the Availability zone.
Configure the Group size and Scaling policies.
Select as per your requirement:
Desired: 4
Minimum: 4
Maximum: 8
Select the Target tracking scaling policy.
Click on the Create Auto Scaling Group.
Now you can see the Auto Scaling is creating and it is also creating the desired state of the EC2 Instance.
We selected the Desired state equal to 4 and you can see the 4 Instance is Running.