AWS Spot Instances: A Practical Guide
February 13, 2026
|
AWS
Spot Instances
Cost Optimization
60-90% discounts for Spot-safe workloads.
Spot Instances: 60-90% Savings
AWS Spot Instances let you use spare EC2 capacity at up to 90% discount compared to On-Demand pricing. The catch? AWS can reclaim them with a 2-minute warning. But with the right architecture, Spot is safe — and incredibly cost-effective.
What Workloads Are Spot-Safe?
| ✅ Good for Spot | ❌ Not Good for Spot |
|---|---|
| CI/CD build agents | Single-instance databases |
| Batch processing / ETL | Stateful session servers |
| Dev/test environments | Real-time trading systems |
| Kubernetes worker nodes | Primary application servers (unless behind ASG) |
| Data analysis / ML training | License-bound software with long startup |
| Web servers behind ALB + ASG | Any single point of failure |
Best Practices for Production Spot
- Diversify instance types — Request capacity across 5-10 instance types and 3 AZs. This dramatically reduces interruption risk.
- Use Spot Fleet or EC2 Auto Scaling mixed instances — Let AWS choose the cheapest available combination.
- Handle interruptions gracefully — Monitor the instance metadata endpoint for the 2-minute warning and drain connections.
- Mix with On-Demand — Use a 70/30 Spot/On-Demand ratio in Auto Scaling Groups for guaranteed baseline capacity.
Spot in Auto Scaling Groups
{
"MixedInstancesPolicy": {
"InstancesDistribution": {
"OnDemandBaseCapacity": 2,
"OnDemandPercentageAboveBaseCapacity": 30,
"SpotAllocationStrategy": "capacity-optimized"
},
"LaunchTemplate": {
"Overrides": [
{"InstanceType": "m5.large"},
{"InstanceType": "m5a.large"},
{"InstanceType": "m6i.large"},
{"InstanceType": "m6a.large"},
{"InstanceType": "m5.xlarge", "WeightedCapacity": "2"}
]
}
}
}
Handling Interruptions
#!/bin/bash
# Check for Spot interruption notice
while true; do
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
http://169.254.169.254/latest/meta-data/spot/instance-action)
if [ "$HTTP_CODE" -eq 200 ]; then
echo "Spot interruption received! Draining..."
# Deregister from ALB, drain connections, save state
exit 0
fi
sleep 5
done
Eazy SaaS Tip: Start with CI/CD and dev environments. Once comfortable, expand Spot to stateless web tiers behind Auto Scaling Groups. Most clients achieve 60-70% average savings across their fleet.