Guide

The same virtual machine can be bought three ways: on demand, under a commitment, or as spot capacity. Each trades flexibility for price. The right mix depends on how steady your load is and whether your jobs survive being interrupted.

Concept

A commitment (a Savings Plan, Reserved Instance or committed use discount) means you agree to pay for a fixed amount of usage for one to three years. In return you pay less per hour. Spot (or preemptible) capacity is spare cloud capacity at a deep discount that the provider can take back with short notice.

The big idea

Think of three ways to travel. On demand is paying per ride. A commitment is a monthly transit pass, cheaper per trip if you use it. Spot is a standby seat that can be taken back at any moment.

The transit pass analogy breaks in one place. A pass you do not use still costs you. Committed spend is paid whether or not you run the machines, so commit only to the baseline you know you will keep.

ModelPriceThe catch
On demandFull hourly rateMost expensive per hour. Good for spiky or unknown load
CommitmentRoughly 30 to 60% offLocked in for one to three years
SpotOften 70 to 90% offReclaimed with short notice: about 2 minutes on AWS, about 30 seconds on GCP

Savings Plans are more flexible across instance families than classic Reserved Instances.

Walking through a fleet

A batch fleet runs 40 m7i.xlarge instances around the clock. Use a rough on-demand rate of $0.20 per hour, and 730 hours in a month.

On-demand:
  40 x $0.20 x 730 h                       = $5,840 / month

Spot at about 70% off ($0.06/h):
  40 x $0.06 x 730 h                       = $1,752 / month

Savings Plan at about 40% off ($0.12/h) for 20 steady instances,
on-demand for the other 20:
  20 x $0.12 x 730 h = $1,752
  20 x $0.20 x 730 h = $2,920
  total                                    = $4,672 / month

Mix: 20 on a Savings Plan, 20 on spot:
  20 x $0.12 x 730 h = $1,752
  20 x $0.06 x 730 h =   $876
  total                                    = $2,628 / month

The mix costs less than half of on-demand, about $2,628 against $5,840. It works only because the 20 spot instances can be interrupted. The batch jobs must checkpoint and the scheduler must retry them.

Serverless is a different trade. Lambda and Cloud Run charge for each request and each second of duration, so there is no idle cost. At high steady traffic, though, a small always-on fleet can be cheaper. Compute the crossover with real durations and memory sizes.

Common mistakes

  • Putting a single-node database on spot. It cannot lose its host on short notice.
  • Committing before rightsizing. You lock in cost for machines you are about to shrink.
  • Locking a three-year commitment on the wrong instance family. You pay for machines you no longer run.
  • Spot without checkpoints. Interruptions then lose the work.

Check yourself

  1. You have 40 instances, and 20 of them are steady. What is the cheapest sensible mix in the example? 20 on a Savings Plan and 20 on spot, about $2,628 per month.
  2. Why can't your one primary database run on spot? Spot capacity can be reclaimed on short notice, and a single-node database cannot move without downtime.

Key takeaways

  • On demand is flexible. Commitments suit steady baselines. Spot suits interruptible work.
  • Commit only to the baseline you are sure you will keep.
  • A mix usually beats any single model.
  • Spot requires checkpoints and retries in the job itself.

Further learning

Next, see the costs that do not show up in the instance line in hidden network and logging costs.