AWS Builder Center

I Stopped Paying On-Demand for Everything: What EC2 Spot Instances Taught Me

How designing batch workloads for interruption with EC2 Spot Instances cut costs by more than two-thirds while making jobs more resilient.

yub 😎
For a long time, every EC2 instance I launched was On-Demand. It was the default, it was simple, and it never surprised me — except on the bill. When I started running batch jobs that processed data overnight, that habit got expensive fast. The jobs did not need to run at a specific minute, and they did not need to run on a specific machine. They just needed to finish before morning. Paying full On-Demand price for that kind of work started to feel like booking a taxi to wait outside my house all night, just in case.
Spot Instances changed the deal. The idea is simple: AWS sells spare capacity at a steep discount, often 60 to 90 percent below On-Demand, and in return it can reclaim that capacity with a two-minute warning when it needs it back. The first time I read that, I dismissed it. Why would I build on machines that can disappear? Then I looked at my actual workload and realized the question was backwards: why was I paying for a guarantee I did not need?
The shift was not about saving money on day one. It was about designing for interruption. My batch job had to become stateless in the ways that mattered. Work was split into small chunks, each chunk wrote its result to S3 as soon as it finished, and progress was tracked in a simple queue so a reclaimed instance just meant one chunk got picked up again. Nothing lived only in memory. Nothing assumed the machine would still be there in ten minutes. That discipline turned out to be useful everywhere, not just on Spot — it is the same discipline that makes a system survive an ordinary instance failure.
There are trade-offs worth being honest about. Spot is a bad fit for anything that cannot be interrupted: a database primary, a long-running interactive session, or a job that must finish by an exact deadline with no slack. Capacity is not guaranteed either. During a spike in demand for a particular instance type in a particular Availability Zone, your request may simply not be fulfilled, or your instances may be reclaimed more often. I learned to diversify — using several instance types and Availability Zones through a fleet request — instead of insisting on one exact type. Flexibility is what makes Spot reliable in practice.
Pricing also surprised me in a good way. Spot prices move with supply and demand, but the old fear of sudden price spikes bidding you out is mostly history. Today you set a maximum price you are willing to pay, and if the Spot price goes above it, the instance is reclaimed rather than charged above your cap. In practice, for the instance types I used, prices stayed well below On-Demand for weeks at a time. The savings were real, but the bigger win was the habit: I started asking, for every workload, "does this actually need a guarantee, or does it just need to get done?"
Here is the simple rule I use now. If a workload is stateful, latency-sensitive, or deadline-critical, it stays On-Demand or Reserved. If it is batch work, CI builds, rendering, or data processing with checkpoints and retries, it goes to Spot first, and I only move it back if interruptions prove too frequent. I also keep one small On-Demand safety net — a single instance that can drain the queue slowly — so a total Spot drought never means zero progress.
The takeaway is not really about Spot at all. It is about matching the price you pay to the guarantee you actually need. On-Demand is a wonderful default, but defaults are expensive when you never question them. Designing for interruption cost me an afternoon of refactoring, and it cut that batch bill by more than two-thirds — while making the whole job more resilient in the process.
What workload in your setup is paying for a guarantee it does not need? I would love to hear where you would — or would not — trust Spot.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article