Skip to main content
>_ supraj.dev
TOPIC CLOUD
Auto Scaling automatically adjusting compute capacity to match demand
IN 10 SECONDS

Auto Scaling monitors metrics like CPU utilization, request count, or queue depth and adjusts the number of running instances accordingly. You define a min, max, and desired capacity. When load spikes, new instances launch automatically. When it drops, excess instances are terminated — saving money without manual intervention.

GOTCHA Scale-in can terminate any instance, including one processing a long request. Use lifecycle hooks to gracefully drain connections before termination. Also, cold start on new instances can take 2-5 minutes — plan your scale-out threshold to trigger before capacity is exhausted.
HOW A SCALE-OUT EVENT WORKS
01 CloudWatch alarm triggers when CPU averages > 70% for 5 minutes across the ASG.
02 Auto Scaling group receives the alarm and initiates a scale-out activity.
03 Launch template specifies the AMI, instance type, security groups, and user data for new instances.
04 New instance boots, runs the user data/bootstrap script, and registers with the load balancer.
05 Cooldown the ASG waits for a configured period (default 300s) before evaluating any further scaling actions.
POKE IT YOURSELF
aws autoscaling describe-auto-scaling-groups — list ASGs and their current capacities
aws autoscaling describe-scaling-activities --auto-scaling-group-name my-asg — see recent scale events