F5 Public Cloud Solutions > 4. Public Cloud Architectures II: F5 in AWS Advanced Use Cases Beyond Native Tools > 4.11. Test Autoscaling Source | Edit on
4.11.1. 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.
base64 /dev/urandom | head -c 3000 > payload
ab -t 300 -c 200 -c 5 -T 'multipart/form-data; boundary=1234567890' -p payload https://x.x.x.x/
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.";
}