Testing the Auto Scaling group
In order to test the Auto Scaling policy we created in the last step, these are the steps we need to follow:
- Log in to any of the instances that were created as part of the Auto Scaling group:
ssh -i <public key> ec2-user@<public ip of the instance>
- Install the
stress
package. This package is a utility that is used to impose load on test systems:yum -y install stress
- Now to add a load on one CPU, we can use the following command; this command will time out after 300 seconds (5 minutes):
stress --cpu 1 --timeout 300&
- If you go back to the Activity tab in the Auto Scaling console, you will see that Auto Scaling will start spinning up a new instance:
Now you know how an Auto Scaling group adds or terminates instances based on the scaling policy.