Saturday, July 18, 2020

AWS Auto Scaling


Description: Here I have explained what is Auto Scaling, Types and Implementation of Auto Scaling.

What is Auto Scaling: Auto Scaling monitor resources of your application server and scale out or scale in resources according to the application's requirement. This will help in an application when there is heavy traffic it automatically adds resources and also in cost management as it automatically removes the server when traffic reduces. 

What Is Amazon EC2 Auto Scaling? - Amazon EC2 Auto Scaling

Types Of Auto Scaling: Below are the types of Auto Scaling
  1. Horizontal Scaling: It increases the number of node without changes resource size  in individual node
  2. Vertical Scaling: It increasing the size and computing power of a single instance or node without increasing the number of nodes or instances
Implementation of Auto Scaling on AWS:
  • I have created one Web server and Create AMI [Amazon Machine Image] by select instance and then click on action.


  • Once you create Image, you will find  under AMI
  • In EC2 navigate to Auto Scaling and click on Launch Configuration

  • Fill all required details like Name, Select AMI, Instance Type, Storage, Security Group and Key Pair and click on Create Launch Configuration


  • You will receive a message once it successfully created 
  • Once Auto Scaling configuration ready, We configure Auto Scaling Group. Click on Auto Scaling group and Create Auto Scaling Group
  • Fill all required details like Name, Auto Scaling Configuration and Security Group

  • Select VPC and subnet click next
  • You can also configure with Load Balancing and enable cloud watch monitoring
  • Next step to configure group size and scaling policies, here you need to set desired, minimum and maximum capacity of instance. 
  • You also need to configure scaling policies like if CPU usage of server is more then 50% then a new instance will be initiated as below image

  • Review configuration and click on Create autoscaling group
  • Once you create autoscaling group, once load increases on CPU new instances will be created and If load reduces automatically it will be terminated
  • You can increase load using below command and see auto-scaling is working or not  
dd if=/dev/zero of=/dev/null

or

fulload() { dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null & }; fulload; read; killall dd



  • You can also monitor the activity of scale-out and scale-in from activity monitor

No comments:

Post a Comment