I need to test autoscaling group creating new instances when CPU utilization cross certain threshold for example 70%.
Is there any way to up the CPU utilization just to test?
I need to test autoscaling group creating new instances when CPU utilization cross certain threshold for example 70%.
Is there any way to up the CPU utilization just to test?
You can use stress command in Linux:
stress --cpu 2 --timeout 60
cpu specifies the number of cores, timeout specifies the number of seconds this command will run.
For Windows: Install Windows Server 2003 Resource Toolkit. Then run this command in cmd:
consume -cpu-time -time 5
If you are testing a web based application, I recommend you try Bees With Machine Guns.
Its a python script that will launch micro EC2 instances and send many web requests from these instances to your application. This will simulate a large surge in traffic for performance testing.
Note the caveat at the bottom of the page that says:
If you decide to use the Bees, please keep in mind the following important caveat: they are, more-or-less a distributed denial-of-service attack in a fancy package and, therefore, if you point them at any server you don’t own you will behaving unethically, have your Amazon Web Services account locked-out, and be liable in a court of law for any downtime you cause.
You have been warned.
Another way to bring CPU utilization up on Posix systems is to use the stress command. Stress generates CPU, memory, I/O or disk workload depending on your configuration.
An example answer here shows how to use stress to bring the memory of an instance to 90%.