Lesson 2 of 6 Amazon EC2

Matching EC2 Purchasing Options to Workloads

This lesson explains the EC2 pricing models that can cut costs dramatically, and how to match each workload to the right model.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish On-Demand, Savings Plans, Reserved Instances, Spot and Dedicated options.
  • Explain how diversification and capacity rebalancing handle Spot interruptions.
  • Explain how purchasing models combine in one design.

The options

EC2 purchasing options trade commitment for discount, and exam scenarios usually describe a usage pattern that points to one of them. On-Demand has no commitment and is billed per second for Linux, so it suits short-term, spiky or unpredictable workloads and anything being tested.

For steady usage, a commitment earns a discount. Savings Plans commit to a dollar amount of compute per hour for one or three years. Compute Savings Plans apply to any instance family, size, operating system and Region, and to Fargate and Lambda, which suits organisations whose usage changes shape; EC2 Instance Savings Plans give a larger discount for one family in one Region. Reserved Instances commit to a specific instance configuration. Standard RIs give the largest discount and can be sold on the RI Marketplace, and zonal RIs also reserve capacity in an Availability Zone; convertible RIs can be exchanged for other types for a smaller discount. Paying more upfront increases the discount.

Spot Instances use spare capacity at up to 90% off, but AWS can reclaim them with a two-minute notice, so they suit stateless, fault-tolerant work that can run on several instance types, such as batch jobs and CI builds. Dedicated Hosts give a whole physical server with visibility of its sockets and cores, which is needed to bring existing per-socket or per-core software licences, such as Windows Server, SQL Server or Oracle. Dedicated Instances run on hardware used by no other customer, without host-level control. On-Demand Capacity Reservations guarantee capacity in one Availability Zone at the On-Demand price, for critical events, and can be combined with Savings Plans for a discount. The following table summarises the options.

OptionDiscountCommitmentBest for
On-DemandNoneNone; per-second billing (Linux)Short-term, spiky, unpredictable
Compute Savings PlansUp to 66%$/hour, 1 or 3 years; any family, size, OS, Region, plus Fargate and LambdaFlexible steady usage
EC2 Instance Savings PlansUp to 72%$/hour for one family in one RegionStable family choice
Standard Reserved InstancesUp to 72%Instance type, Region, tenancy; sellable on the RI Marketplace; zonal RIs reserve capacitySteady 24/7
Convertible Reserved InstancesLessExchangeable for other typesSteady but changing
SpotUp to 90%None; 2-minute interruption noticeStateless, fault-tolerant, flexible
Dedicated Hosts—A physical server; socket and core visibilityBYOL (Windows Server, SQL Server, Oracle), compliance
Dedicated Instances—Hardware isolation, no host controlIsolation requirements
On-Demand Capacity ReservationsOn-Demand price (combine with Savings Plans)Capacity in one AZGuaranteed capacity for critical events

Paying more upfront (all, partial, none) gives a bigger RI discount.

The following diagram arranges the options from no commitment to the largest committed discount.

EC2 purchasing options and the usage each suits. On-Demand has no commitment, for spiky or short-term work. Savings Plans and Reserved Instances trade a one- or three-year commitment for a discount on steady usage. Spot Instances use spare capacity at up to 90% off but can be reclaimed with two minutes' notice. Dedicated Hosts give a whole physical server, for licences tied to sockets or cores.
Dedicated Hosts are chosen for licensing or compliance rather than discount, and Spot depends on the workload tolerating interruptions.
Scenario questions

Choosing a purchasing option

Exam skills 4.2.3 · 4.2.4

Choose the EC2 purchasing option for each usage pattern.

Log in to try this activity Interactive activities are free with an account.

Handling Spot interruptions

Spot Instances can be reclaimed with two minutes' notice, so workloads that use them must tolerate interruption. The most effective measure is diversification: requesting capacity across many instance types and Availability Zones with the price-capacity-optimized allocation strategy, through EC2 Fleet, Spot Fleet or an Auto Scaling group, so that capacity comes from the pools least likely to be interrupted.

Auto Scaling capacity rebalancing acts on rebalance recommendations, which often arrive before the interruption notice, by launching a replacement before the at-risk instance is reclaimed. Long-running jobs should checkpoint their progress regularly, and applications should react to the two-minute notice, available from instance metadata or as an EventBridge event, by draining work and saving state.

Select all that apply

Living with Spot

Exam skills 4.2.3 · 2.2.4

Identify the practices that make Spot workloads resilient.

Log in to try this activity Interactive activities are free with an account.

Combining models

Cover the steady baseline with Savings Plans or RIs, predictable peaks with On-Demand or scheduled scaling, and flexible work with Spot. An Auto Scaling group with a mixed instances policy does all of this in one fleet.

Worked example

Combining purchasing options

A web application needs 10 instances all day, rises to 30 during business hours, and a nightly batch job uses 50 instances for two hours but can be restarted if interrupted.

UsageOption
The steady 10 instancesSavings Plan (1 or 3 years)
The extra 20 during business hoursOn-Demand, scaled by Auto Scaling
The nightly batchSpot Instances, diversified across instance types

Committing to 30 instances would waste money every night; running the batch On-Demand would cost up to ten times more than Spot. Layering the options to match each part of the demand is the cost-optimised design.

Check yourself

Which purchasing option gives the largest discount for fault-tolerant batch jobs that can be interrupted?

Show answer

Spot Instances, which can be reclaimed with a two-minute warning, so the jobs must tolerate interruption.

Exam Tips

Remember for the exam

  • Steady 24/7 workloads suit Savings Plans or Reserved Instances.
  • Fault-tolerant batch jobs at the lowest cost suit Spot.
  • Software licensed per socket or per core requires Dedicated Hosts.
  • To guarantee capacity for a short, critical event without a long commitment, use an On-Demand Capacity Reservation.
  • For a baseline, peaks and flexible work in one fleet, combine Savings Plans, On-Demand and Spot in a mixed instances Auto Scaling group.
  • To reduce Spot interruptions, diversify instance types and zones and use price-capacity-optimized allocation.