Spot instances
Spare cloud servers rented at a deep discount, but taken back on short notice.
Cloud providers keep far more servers than they are using at any moment, so they can always hand capacity to whoever asks. Spot instances are how they rent out that idle capacity: the same virtual machines as usual, at a big discount, with one condition. When the provider needs the capacity back for a full-price customer, it takes it, and your machine is stopped or shut down.
On AWS, EC2 Spot can cost up to roughly 90% less than the normal on-demand price, and the price moves slowly with supply and demand for each instance type and Availability Zone. You get a two-minute warning before an interruption, which your software can read to save its work. Google Cloud (Spot VMs) and Azure (Spot Virtual Machines) offer the same idea with their own rules.
Spot is a good fit for work that can be paused, retried or split: batch processing, rendering, data analysis, CI/CD builds, training jobs with checkpoints, or stateless web servers behind a load balancer with enough copies. It is a bad fit for a single database or anything that must not stop. The common pattern is a mix: a base of regular or reserved capacity for what must stay up, and spot on top for the rest, spread across several instance types so one shortage does not take everything at once.
Keep in mind
- Same machines, big discount, but they can be reclaimed.
- On AWS you get a two-minute notice before an interruption.
- Great for batch jobs, builds and anything that can restart.
- Mix with regular instances and spread across instance types.