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.

../../_images/1_ab_test_app.png

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/
../../_images/2_create_cpu_churn_irule.png

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.";
}
../../_images/3_paste_cpu_churn_irule.png ../../_images/4_attach_irule_1.png ../../_images/5_attach_irule_2.png ../../_images/7_https_app.png ../../_images/8_cpu_usage.png ../../_images/9_active_alerts.png ../../_images/10_alert_history.png ../../_images/11_alert_rules_11.png ../../_images/12_alert_rules_12.png ../../_images/13_health_critical_1.png ../../_images/13_health_critical_2.png ../../_images/14_bigip_initializing.png ../../_images/15_asg_details.png ../../_images/16_asg_instances.png ../../_images/17_ssg_max_instances.png ../../_images/18_ssg_another_device.png ../../_images/19_login_another_bigip.png