In real-life, the traffic load on a application can change from time to time, a shopping website is likely to have more load during the day time over night time. With the Auto Scaling Group (ASG), you can unload the over-provisioned resources and severs automatically to get rid of unnecessary capacity to optimise cost.

The goal of ASG is to:

  • Scale out (i.e. add EC2 instances) to match an increased load.
  • Scale in (i.e. remove EC2 instances) to match an decreased load.
  • Automatically register new instances to a load balancer.
  • Auto scaling to different AZs
  • Replace unhealthy instances.

When creating ASG, you will be asked to create a launch template for all the subsequent EC2 instances that will be created by the ASG.

Scaling groups

You can define a range of minimum capacity, desired capacity, and maximum capacity for the ASG. The ASG can scale out or in as needed within your defined range.

  • Minimum capacity Represents the minimum group size. When scaling policies are set, they cannot decrease the group’s desired capacity lower than the minimum capacity.
  • Desired capacity Represents the initial capacity of the Auto Scaling group at the time of creation. An Auto Scaling group attempts to maintain the desired capacity. It is a dynamic parameter that can be adjust at anytime based on the load.
  • Maximum capacity Represents the maximum group size. When scaling policies are set, they cannot increase the group’s desired capacity higher than the maximum capacity.

Scaling strategies

Manual scaling

Update the size of an ASG manually.

Dynamic scaling

Respond to changing demand

  • Simple / step scaling
    • When a CloudWatch alarm is triggered (i.e. CPU > 70%), then add 2 units.
    • When a CloudWatch alarm is triggered (i.e. CPU < 30%), then remove 1 unit.
  • Target tracking scaling
    • i.e. You want the average ASG CPU to stay at around 40%.
  • Scheduled scaling
    • Anticipate a scaling based on known usage patterns. (i.e. increase the minimum capacity to 10 at 5 p.m. on Fridays)
  • Predictive scaling
    • Use Machine Learning to predict future traffic ahead of time.
    • Automatically provisions the right number of EC2 instances in advance.

Back to parent node: Cloud Computing

Cloud_computingAWSComputeAWS_CLF-C02ASGScalability

Reference - Udemy Ultimate AWS Certified Cloud Practitioner CLF-C02