AWS Classroom Series – 13/Oct/2021

AWS Horizontal Scaling and Elasticity

  • To make my application highly available i would run application on multiple ec2 instances and some how when user makes a request these ec2 instances will share the load.
  • As a first step, lets try to run an Application inside ec2 instance i.e. same AMI in multiple ec2 instances shared across AZ’s
  • To do this we need to have an AMI
  • To create multiple ec2 instance running your application, we can use auto scaling group.
    • While creating ec2 instances you can give count of number of instances Preview
    • This will also create multiple ec2 instances, but it will not try to maintain count i.e. when we create an auto scaling group and specify the count is 2, Autoscaling will ensure that you will always have a minimum of two instance running your application.
    • Auto scaling tries to maintain the desired count. Preview
  • Lets create an Auto Scaling Group (ASG) with 2 count as desired Preview Preview
  • To create the ASG we need launch template or launch configuration Preview
  • For this fixed scaling lets use launch configuration Preview
  • Launch Configuration will consist of AMI details and other info to launch an ec2 instance or group of instances Preview Preview Preview Preview Preview Preview Preview Preview
  • As we are setting the fixed size auto scaling group Scaling policy is None Preview Preview Preview Preview Preview Preview Preview
  • Now try doing some terminations, shutdowns of the ec2 instance in the autoscaling and aws will always try to maintain the desired state.
  • Once you have done with your work, ensure that you have deleted the auto scaling group. Preview
  • Next Steps:
    • Dynamically scaling out (increasing number of instances) and scaling in (decreasing number of instances) as per application needs => Elasticity and Autoscaling.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin