Services >> Cloud >> AWS >> Tutorials >> How to test EC2 autoscaling based on scaling policy of CPU load above a certain percentage

 

  1. create a launch configuration
  2. test that it can launch your ec2 instance, then terminate the instance
  3. Create Auto Scaling Group, using existing launch template and select the template you created earlier
  4. Set the Desired, Min, Max AZ, Subnets
  5. Add scaling policy set to Average CPU Utilization at your desired %, specify the warm up time for the instance
  6. In the running instances, install stress

    sudo su -
    yum install -y stress
    stress --cpu 1 -v --timeout 300


  7. Watch CPU utilization from CloudWatch, it will start to peak
  8. Notice the new instances added by auto scaling