All cheat sheets
Serverless & AIcheat sheet

GameLift Spot Fleets

Run multiplayer game servers on Spot capacity with an On-Demand buffer and let GameLift FleetIQ handle the 2-minute interruption choreography — typically 70–85% cheaper than pure On-Demand, invisible to players.

Last reviewed: July 14, 2026

TL;DR: Spot is unused EC2 sold at 70–90% off with a 2-minute reclaim warning. That sounds fatal for game servers until GameLift's FleetIQ turns the 2-minute window into something players never see: it drains the instance, moves or finishes sessions, and brings replacement capacity online — steering toward the healthiest Spot pool and falling back to your On-Demand buffer only when Spot is genuinely thin. You write a graceful-shutdown hook; GameLift runs the fleet-level dance. Result: routinely 70–85% lower compute, negligible player impact.

The numbers

  • Spot discount: typically 80–90% off On-Demand; narrows to 50–60% under extreme regional demand; capped at the On-Demand price — you can never pay more.
  • Reclaim warning: 2 minutes — long enough to drain new traffic, fire a shutdown hook, and migrate sessions.
  • Session-length → ratio: short (<10 min) → 90–95% Spot; medium (10–60 min) → 85/15, expect 70–80% off; long (1h+) → 60–70% Spot unless you checkpoint; persistent/MMO → 50–70% Spot only with stateless servers.
  • Field examples: an AAA studio hit $2M+/yr savings post-rollout; a mobile studio with 2–5 min sessions ran 95% Spot scaling to near-zero off-peak.

Do this

  1. Start conservative at 70/30 Spot/On-Demand, watch interruption metrics 2–4 weeks, then dial Spot up on real numbers.
  2. Diversify aggressively — allow 5–10 instance types across families (c5, c5a, c5n, c6i, c7i…). Each type is its own Spot pool; pinning to one defeats FleetIQ entirely.
  3. Implement the graceful-shutdown hook: on interruption signal, stop accepting new players, finish or migrate the session, persist external state, exit clean. This is the most important code change.
  4. Wire CloudWatch alarms on PercentInterrupted, ActiveInstances, IdleInstances; alarm above ~2–3% sustained (widen diversity or raise the On-Demand buffer).
  5. Drill interruptions in staging — AWS lets you simulate them; discover broken shutdown logic in dev, not at peak.

Gotchas

  • Diversification, not the Spot ratio, is the key knob. One instance type = nowhere to go when that pool dries up; 5–10 types = astronomically unlikely to all vanish at once.
  • GameLift Anywhere fleets can't use Spot — the savings story only applies to AWS-hosted GameLift fleets.
  • The "Spot is unreliable" reputation is stale — modern Spot + diversification + FleetIQ hits 99%+ effective availability. The teams that get burned pinned one type, ran 100% Spot with no buffer, or skipped the shutdown hook.
  • Local server state is the real blocker — if interruption means lost progress, refactor to stateless (state in DynamoDB/Aurora/ElastiCache) before pushing Spot up.

Skip this if

  • Latency-critical competitive/ranked/eSports modes — run those On-Demand or Reserved; save Spot for casual/practice (often 70–80% of traffic). See Spot Instances for the general Spot model.
  • Very long sessions with no checkpointing — a 2-hour match restarting from scratch is a bad experience until you add save/resume.
  • The team has no bandwidth to write interruption hooks — "just turn on Spot" without a shutdown path eventually bites.

Run this audit with your AI assistant

Paste this into Claude, ChatGPT, or any agent that can run the AWS CLI with read-only credentials. It audits your account for exactly the waste this sheet describes — and changes nothing.

You are auditing an AWS account's Amazon GameLift fleets for Spot
savings. Use the AWS CLI with READ-ONLY credentials. Do not create,
modify, or delete anything — report findings and recommended (unapplied)
fixes only.

1. Inventory: aws gamelift describe-fleet-attributes — list fleets with
   FleetType (ON_DEMAND vs SPOT), InstanceType, and Status. Note any
   fleet running 100% On-Demand.
2. Diversification check: aws gamelift describe-fleet-capacity and the
   fleet's allowed instance types — flag fleets pinned to a SINGLE
   instance type (defeats FleetIQ; the whole savings mechanism needs
   5–10 types across families).
3. Interruption exposure: pull CloudWatch AWS/GameLift metrics per Spot
   fleet — PercentInterrupted, ActiveInstances, IdleInstances. Flag
   sustained interruption >2–3% (widen diversity or raise On-Demand
   buffer).
4. Session profile (ask the user, include in report): average session
   length and whether servers persist state locally. Short/stateless =
   push Spot ratio high; long/stateful-local = needs checkpointing
   before high Spot ratios are safe.
5. Estimate: for each On-Demand-heavy fleet, savings ≈ On-Demand $/mo ×
   (target Spot fraction) × ~0.75 (typical Spot discount).

Report a table: fleet | type | instance types allowed | est. Spot
discount | interruption % | recommended Spot/On-Demand ratio | est.
$/mo saved. Note GameLift Anywhere fleets can't use Spot. Change nothing.
Works with any assistant that can run shell commands.

Want the guided version?

The GameLift Spot Fleets walkthrough covers this topic interactively — it asks about your setup, branches to what’s relevant, and quizzes you on the tricky parts. Free and anonymous.

Start the walkthrough