F5 Public Cloud Solutions > Public Cloud Architectures II: F5 in AWS Advanced Use Cases Beyond Native Tools > Test Autoscaling Source | Edit on
Test Autoscaling based on CPU usage¶
Autoscaling based on a combination of high cpu or throughput is a good way to scale out during periods of heavy use without over-investing in idle capacity.

From the Super-NetOps terminal, generate some traffic to the example app2 application. Replace x.x.x.x with the public IP address of your app2 application.

Apply the cpu_churn iRule to simulate high cpu.
when HTTP_REQUEST {
set s [string repeat 0123456789 7000]
set regex {(?:3[4|7]\d{2})(?:[,-]?(?:\d{5}(?:\d{1})?)){2}|(?:4\d{3})(?:[,-]?(?:\d{4})){3}|(?:5[1-5]\d{2})(?:[,-]?(?:\d{4})){3}|(?:6011)(?:[,-]?(?:\d{4})){3}}
set idx [regexp -all -inline -indices $regex $s];
HTTP::respond 200 content "Regex completed - wow, that was tiring.";
}
















