3.28 Requests from floating bodies

This lesson focuses on EC2 spot requests. A spot instance gives you up to 90% discount versus on-demand pricing. The principle is simple: you set a maximum price you are willing to pay per hour, and as long as the spot price stays below your maximum, the instance keeps running. If the spot price exceeds your bid, AWS reclaims the instance. You then have a two-minute grace period to gracefully shut down or save state before termination.

Spot request strategies

  • One-time request: the request disappears once the instance is launched.
  • Persistent request: stays active; AWS automatically relaunches your instance when the spot price drops below your maximum again.
  • Spot blocks: guarantee uninterrupted runtime from 1h to 6h without reclaim (very rare exceptions).
  • To terminate a spot instance, the request must be in open, active, or disabled state — never failed, canceled, or closed.

Spot instances suit interruptible workloads only: data analysis, batch processing, fault-tolerant background tasks. They never suit critical workloads, production databases, or long-running stateful services. The pricing chart for a m4.large Linux over three months typically shows spot prices well below the on-demand rate, with occasional spikes when capacity tightens — that is when you risk losing your instance.

For larger workloads, spot fleets aggregate spot and (optionally) on-demand instances to reach a target capacity automatically. You define pools (instance types, AZs, regions, OS) and an allocation strategy: lowest price picks the cheapest pool, diversified spreads across pools to maximize availability, and capacity-optimized picks the pool with the most available capacity. Spot fleets automatically start and stop instances to meet your target capacity while staying within your maximum price. This combination of bidding, fleets, and persistent requests delivers significant cost savings on the right kinds of workloads.