Spot Instances and Preemptible VMs
What you'll learn: How to dramatically reduce compute costs by using spare cloud capacity that can be interrupted.
The Core Idea
Cloud providers operate massive data centers with fluctuating demand. Rather than let spare compute capacity sit idle, they offer it at steep discounts—often 60-90% off on-demand pricing. The catch? They can reclaim these resources with short notice (typically 30 seconds to 2 minutes) when paying customers need the capacity.
AWS calls these Spot Instances, GCP calls them Preemptible VMs (and now Spot VMs), and Azure offers Spot Virtual Machines.
When to Use Them
Think of spot/preemptible capacity like standby airline tickets—amazing deals if you're flexible about timing and can handle last-minute changes.
Perfect workloads:
- Batch processing jobs that can checkpoint and resume
- CI/CD test environments and build pipelines
- Data analysis that can be rerun if interrupted
- Stateless web workers behind load balancers
- Rendering farms and scientific simulations
Avoid for:
- Databases or stateful services without replication
- Real-time user-facing applications
- Jobs that can't tolerate interruption
Making It Work
To use spot capacity effectively, design for interruption:
- Implement graceful shutdown handlers that respond to termination signals
- Use checkpointing to save progress regularly
- Spread workloads across multiple instance types and availability zones
- Combine with on-demand or reserved instances for critical baseline capacity
Key Takeaway: Spot Instances and Preemptible VMs offer dramatic cost savings (60-90%) for interruptible, fault-tolerant workloads—perfect for batch jobs, testing, and stateless processing that can handle graceful shutdown.