Stressing EC2 to see Auto-scale in Action
- Login to both the instance created by auto-scaling group and run below commands on both
sudo su yum install stress -y stress -c 70
- Above commands will basically put a load 70% on both of your instance which should ideally trigger your Auto-Scaling policies and add one more EC2 instance to your group
As auto-scaling depends on cloudwatch to provide utilization data and we are using basic monitoring as of now, it will take 5 min of 70% CPU load to add more instance
- Now delete your auto-scaling group then launch configuration, this will also delete the EC2s
- Also delete the AMI which was created in previous lab