← Lessons

quiz vs the machine

Platinum1750

System Design

Spot Instances and Cost

Using interruptible spare capacity at deep discounts for fault tolerant workloads.

5 min read · advanced · beat Platinum to climb

Cheap but interruptible

Spot instances are spare cloud capacity offered at a steep discount, often well below the on demand price. The catch is that the provider can reclaim them with little notice when it needs the capacity back. They are interruptible by design.

When to use them

Spot fits fault tolerant, stateless, or batch workloads that can absorb interruption:

  • Big data processing and rendering jobs.
  • Stateless web workers behind a load balancer.
  • CI runners and other retryable tasks.

Avoid spot for stateful, latency critical, or single point services that cannot tolerate sudden loss.

Surviving interruptions

  • Diversify request several instance types and zones so one shortage does not take everything.
  • Handle the warning the platform gives a short termination notice, so drain work and checkpoint progress.
  • Mix capacity combine a baseline of on demand or reserved instances with spot for the burst portion.

Cost strategy

A common pattern is a stable on demand base for guaranteed capacity plus spot for elastic, cost sensitive scaling. This balances savings against reliability.

Key idea

Spot instances trade interruptibility for deep discounts, ideal for fault tolerant and batch work, and are made safe by diversifying, handling termination notices, and mixing with on demand baseline capacity.

Check yourself

Answer to earn rating on the learn ladder.

1. What is the main tradeoff of spot instances?

2. Which workload is a good fit for spot instances?

3. How do you reduce the impact of spot interruptions?