Learn how Auto Scaling Groups maintain application availability and cost efficiency using scaling policies, health checks, and launch templates.
Auto Scaling — Automatically Adjusting Capacity
Auto Scaling automatically adds servers when you need more capacity and removes them when you need less. This keeps your application performing well during traffic spikes and saves money during quiet periods.
Teacher Note: Think of a ride-sharing company. At rush hour, they activate more drivers. At 3am, most drivers log off. Auto Scaling does the same for your servers — automatically.
Auto Scaling Group Configuration
| Setting | Purpose | Example |
|---|
| Minimum | Always keep this many instances running | 2 (never go below 2) |
| Maximum | Never exceed this many instances | 10 (cost control) |
| Desired | Target number right now | 4 (current running count) |
Scaling Policies
| Policy | How it Works | Best For |
|---|
| Target Tracking | Maintain a target metric — e.g. keep CPU at 70% | Simple, most recommended |
| Step Scaling | Add 2 instances when CPU 70-80%, add 5 when CPU 80-90% | Granular control |
| Scheduled | Scale up at 8am every weekday, scale down at 8pm | Known traffic patterns |
| Predictive | ML predicts load and pre-scales before traffic arrives | Recurring patterns, launch ready |
Launch Template vs Launch Configuration
- Launch Template: NEWER — supports versioning, Spot and On-Demand mix, multiple instance types — USE THIS
- Launch Configuration: OLDER — being deprecated — avoid in new architectures
ASG Health Checks
- EC2 Health Check: is the instance running? (default)
- ELB Health Check: is the application responding correctly on the defined path? (recommended for web apps)
- If instance fails: ASG terminates it and launches a replacement automatically
Exam Tip: Target Tracking is almost always the correct answer for scaling policies. The most common exam pattern: ALB + ASG with Target Tracking on CPU or RequestCountPerTarget. Scale-in protection prevents instances from being terminated during important operations.