Monday 24 August 2020

Auto Scaling EC2

 Achieving full automation for your infrastructure to auto scale based on the load.


what is an auto scaling group?

in the real- life, the load on your websites and application can change.

Suppose SAP server will have more load during office times, As most of the business users login and perform their activities. Assume that office times are from 9:00AM to 6:00PM. From 6:00 PM to next day 9:00 AM the load on same server will be comparatively less.

The goal of an Auto Scaling Group (ASG) is to:

  •  scale out(add EC2 instances) to match an increased load
  •  Scale in (remove EC2 instances) to match a decreased load
  • Ensure we have a minimum and a maximum number of machines running
  • Automatically register new instances to a load balancer.


    Case study: Suppose below picture is requirement for one application. with
  • minimum - 1 EC2 instance.
  • Actual size /Desired capacity - 3 EC2.
  • Maximum size - 6 EC2 instance.
  • Scale out needed - 3 EC2 instances.
in idea cases the Application use 3 EC2 instances, only in some special case when the load is very low then minimum - 1 EC2 will be up and running. Maximum case will be 6 EC2 instance depends on load.






Auto Scaling Group in AWS with Load balancers concept:
 

  • Let us assume an Auto Scaling Group(ASG) with 3 EC2 instances.

  • When ever web traffic or user traffic comes straight in to load balancer.


  • load balancer will distribute the load to EC2 instances.
         

  • If the web traffic or user traffic keep on increase, then automatically new EC2 instance will launch by Auto Scaling Group(ASG).

if the traffic keeps on increasing, then the Auto Scaling Group with launch 5th EC2 instance automatically.



if the traffic keeps on increasing, then the Auto Scaling Group with launch 6th EC2 instance automatically.




Similarly the EC2 instance scale out to either 5 or 4 or 3 or 2 or 1 based on the load comes in to load balancer.

This is how we will automate infrastructure using Auto Scaling Groups(ASG).


No comments:

Post a Comment