AWS SAA – Lecture 45: Spot Instances & Spot Fleet

Published on
Written by Henry Nguyen

Phase Verbs / Action Phrases

PhraseMeaning
reclaim (an instance)AWS takes back a spot instance when spot price exceeds your max
cancel (a spot request)stop AWS from launching new spot instances
terminate (an instance)permanently stop and delete the instance
diversify (across pools)spread instances across multiple launch pools for resilience
fulfill (a spot request)AWS successfully launches the requested spot instances

Technical Vocabulary

TermDefinition
Spot InstanceEC2 spare capacity; up to 90% discount; can be terminated when spot price exceeds max price
Max Spot PriceUser-defined ceiling price; instance runs while spot price ≤ max
Spot PriceCurrent market price for spare capacity in an AZ; fluctuates hourly
Two-minute grace periodWarning time before spot instance is stopped/terminated
Spot RequestA bid document defining instance count, max price, AMI, valid time range, and request type
One-time requestSpot request that disappears after instances are launched once
Persistent requestSpot request that automatically relaunches instances if they are interrupted
Spot FleetA collection of Spot Instances (and optionally On-demand) chosen from multiple launch pools
Launch poolA combination of instance type, OS, and AZ available for Spot Fleet to draw from
lowestPrice strategySpot Fleet picks the pool with the cheapest price
diversified strategySpot Fleet distributes instances across all defined pools
capacityOptimized strategySpot Fleet picks the pool with the most available capacity
priceCapacityOptimized strategySpot Fleet picks highest capacity first, then lowest price within that (best for most workloads)

Key Concepts

How Spot Pricing Works

  • You define a max spot price you’re willing to pay
  • As long as current spot price ≤ max price → instance runs
  • If spot price exceeds max price → 2-minute grace period → instance stopped or terminated
  • Spot price varies per AZ (same instance type can have different spot prices across AZs)
  • Can be 60-90% cheaper than on-demand in practice

Spot Request Types

TypeBehavior
One-timeRequest fulfilled → instances launched → request disappears
PersistentRequest stays active; if instances are interrupted, AWS automatically relaunches them when price permits

Correct Order to Terminate Spot Instances (Exam Critical!)

Wrong order (do NOT do this):

  1. Terminate instances first
  2. Spot request sees 0 instances → auto-launches new ones → you’re stuck in a loop

Correct order:

  1. Cancel the spot request first (prevents new instance launches)
  2. Then terminate the existing spot instances

A cancelled spot request does NOT automatically terminate already-running instances — you must do that yourself.

Spot Fleet

  • A fleet = set of Spot Instances + optionally On-demand instances
  • You define multiple launch pools (different instance types, OS, AZ combinations)
  • Fleet automatically picks the best pool based on your chosen strategy
  • Fleet stops launching when it reaches target capacity or budget

Spot Fleet Allocation Strategies

StrategyBehaviorBest For
lowestPriceAlways pick cheapest poolShort workloads, max cost saving
diversifiedSpread across all poolsLong workloads, high availability
capacityOptimizedPick pool with most available capacityWhen availability matters most
priceCapacityOptimizedHighest capacity first → lowest price within thatBest choice for most workloads

Use Cases Summary

WorkloadSpot OK?
Batch jobs✅ Yes
Data analysis✅ Yes
Image processing✅ Yes
Resilient distributed workloads✅ Yes
Databases❌ No
Critical applications❌ No

Exam Tips

  • Spot = cheapest EC2, but interruptible — 2-minute warning before reclaim
  • Persistent requests auto-relaunch → must cancel request BEFORE terminating instances
  • One-time request: disappears after fulfillment — no auto-relaunch
  • Spot Fleet picks from multiple pools; spot request targets one specific pool
  • priceCapacityOptimized = recommended strategy for most Spot Fleet workloads
  • lowestPrice = best for short/quick cost-optimized tasks
  • diversified = best for long-running, high-availability workloads