CLOUD / A CONCEPT NOTE
Spot Instances
cheap machines that vanish
Overview · mechanism
pitfall · examples
01 / THE SHORT VERSION
The idea in a few sentences.
Spot (or preemptible) instances let you bid on unused cloud compute capacity at a discount (up to 90%). The catch: the provider can reclaim the machine with a 2-minute warning.
02 / FOLLOW THE MECHANISM
How spot preemptions flow
Request
user requests 10 Spot instances for batch job tasks.
Allocation
cloud provider assigns idle VM nodes at discounted pricing.
Reclaim warning
cloud needs capacity back, sending a 2-minute metadata warning to VM.
Eviction
resilient workload drains current transactions and exits before VM terminates.
04 / COMMAND NOTES
Read the command, then the result.
Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.
poll AWS metadata endpoint for termination alerts
curl -H 'Metadata: true' http://169.254.169.254/latest/meta-data/spot/termination-time05 / CHECK YOURSELF
Could you explain Spot Instances to a teammate?
Try it out loud in two sentences: what it is, and the one detail that changes the picture. If you stall, the gap is the part to reread.
Up next in Cloud architectureAWS PrivateLinkprivate connections without public internet