Spot Instances: Trade Reliability for Huge Cost Savings

Spot Instances let you use spare AWS compute for up to 90% off. They're great for fault-tolerant jobs like batch processing or CI/CD. The footgun: AWS can reclaim your instance with a two-minute warning, so don't use them for critical workloads.
Why it exists
Cloud providers have massive amounts of unused compute capacity at any given moment. Selling this spare capacity at a discount benefits both the provider, who generates revenue from idle resources, and the customer, who gets compute for cheap. Spot Instances are the mechanism for this market.
The mental model
Think of Spot Instances like flying standby on an airline. You're not guaranteed a seat, and you might get bumped if a full-fare passenger needs it, but you pay a fraction of the price. You trade reliability for a steep discount. The "seat" is an EC2 instance, and the "full-fare passenger" is AWS needing that capacity back for an On-Demand or Reserved Instance user.
How it works
You request a Spot Instance from a "Spot capacity pool," a set of unused EC2 instances of a specific type in a specific Availability Zone. The price fluctuates based on long-term supply and demand. Your instance runs as long as capacity is available. If AWS needs the capacity back, it issues a two-minute interruption notice before stopping, terminating, or hibernating your instance. You can create persistent requests that automatically try to acquire a new instance if your current one is interrupted.
When to use it
Use Spot Instances for workloads that are fault-tolerant, stateless, and flexible about when they run. Three great use cases are: first, large-scale data processing and analysis jobs; second, batch processing systems for tasks like image rendering or video transcoding; and third, continuous integration and deployment (CI/CD) pipelines, where you need temporary compute to run tests and builds.
When not to use it
Avoid Spot Instances for any application that cannot handle sudden interruptions. This includes critical production databases, stateful applications that can't easily checkpoint and resume, or primary user-facing web servers where downtime is unacceptable. The two-minute warning is not enough time to gracefully handle complex state migration for these types of services.
One canonical example
A media company needs to transcode a large library of video files into different formats. This is a massive, parallelizable batch job. They can spin up hundreds of Spot Instances to process the videos. If some instances are interrupted, a job management system simply re-queues the failed tasks to be picked up by other existing or new Spot Instances. The overall job still completes, but at a fraction of the cost of using On-Demand instances.
Interview question
Which type of workload is generally LEAST appropriate for AWS Spot Instances?
- a.Large-scale data analysis that can resume from interruption
- b.Continuous integration and deployment pipelines
- c.Batch processing for video transcoding
- d.A primary, stateful production databaseCorrect
Why? this is the answer
Spot Instances are explicitly advised against for critical production databases or stateful applications due to their potential for sudden interruption. The other options (batch processing, data analysis, CI/CD) are all cited as suitable use cases because they are fault-tolerant and can handle interruptions.
Just read this? Test yourself on what you have been reading.
Read the original → docs.aws.amazon.com
- #aws
- #ec2
- #cloud computing
- #cost optimization
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on aws — each one lists the topics its interview covers.
See open roles