0

I want to create a Step scaling policy and want to add instances for the below CPU utilization values 80% - 85% => Add 1 CPU instance 85% or above => Add 1 more CPU instance

My question is how I can test if that is working fine. Is there any way to achieve exactly 80-85% of average cpu utilization on an EC2 instance? I know about JMeter and other tools but are there any tools on AWS or a third party that can help me achieve exact CPU utilization?

Note: This is a windows instance.

Maurice
  • 11,482
  • 2
  • 25
  • 45
Ali Mohsan
  • 326
  • 2
  • 15

1 Answers1

1

luk2302 points out a valid solution to get to 100% CPU usage, but if you want to get more specific, you can use a tool like stress-ng to try to create a core utilisation roughly a specific percentage.

This command basically tells it to stress all cores (-c = 0, you can also specify a number here) up to a load of 85% (-l 85). As you can see from the history it's not an exact science, modern CPUs and OSs are incredibly complex, but it's good enough for my use cases.

stress-ng -c 0 -l 85

enter image description here

On Ubuntu you can just install it using:

sudo apt install stress-ng

Credit where credit is due, I found it in a serverfault question a while ago: Serverfault - the author of the tool even replied there.

Maurice
  • 11,482
  • 2
  • 25
  • 45