Sub topic 1
The On-Demand baseline and why discounts exist
On-Demand pricing is the reference point for every other EC2 pricing model. This chapter explains what On-Demand is, why AWS offers discounts below it, and what you give up to get them.
Prerequisites
This chapter assumes you already know:
- What an Amazon EC2 instance is, and how instance families (such as c5 or m5) and sizes (such as large) are named.
- What an AWS Region and an Availability Zone are.
- How to run an AWS CLI command or find a service in the AWS Management Console.
- That cloud billing is pay per use, so cost follows what you run.
What On-Demand pricing is
With On-Demand pricing, you pay a fixed rate for each instance-hour (or second, for Linux instances) while an instance runs. You make no upfront payment and no long-term commitment. You can start an instance when you need it and stop it when you are done.
The rate depends on the instance type, the Region, the operating system, and tenancy. It does not depend on how long you have used AWS or how much you have used.
On-Demand gives you two things: flexibility and no commitment risk. If your workload disappears tomorrow, your bill drops to zero for that workload. You pay for this flexibility with the highest hourly rate of any EC2 pricing model.
Why discounts exist
AWS builds capacity ahead of demand, and that capacity costs money whether or not it is used. Two situations make a discount worthwhile for AWS:
- Predictable demand. If you promise to pay for a certain amount of usage over one or three years, AWS can plan capacity and revenue with more certainty. It passes part of that benefit to you as a lower rate.
- Spare capacity. At any moment, some capacity in each Region is unused. Selling it at a discount is better than leaving it idle, as long as AWS can take it back when On-Demand customers need it.
These two situations map to the two kinds of discount you will study in this tutorial.
| Model | What you give up | Typical use |
|---|---|---|
| On-Demand | Nothing, but you pay the most | New, short, or unpredictable workloads |
| Commitment (Reserved Instances, Savings Plans) | Flexibility: you pay for the commitment even if you use less | Steady, long-running baseline load |
| Spot | Reliability: AWS can interrupt your instances | Fault-tolerant, flexible workloads |
The trade-off in one picture
Every discount trades something for a lower price. Commitments trade flexibility. Spot trades reliability.
A worked comparison
Suppose a service needs 10 instances all day, every day, plus up to 20 more for a few hours during a nightly batch job.
- The 10 always-on instances are steady. A commitment fits them, because you will use the committed amount every hour.
- The 20 batch instances run briefly. A commitment would be wasted for most of the day. They are better as On-Demand, or as Spot if the job can restart after an interruption.
Paying On-Demand for all 30 instances works, but it pays the highest rate for capacity you could have discounted. This is the core idea behind the later chapters: match each part of your load to the cheapest model whose downside you can accept.
Common mistakes
- Treating On-Demand as the wrong choice. It is the right choice for new workloads, spikes, and anything you have not yet measured.
- Committing before measuring. A commitment sized on a guess can leave you paying for unused hours.
- Assuming a discount has no cost. Every discount has a trade-off, either commitment or interruption risk.
Exercise
A team runs 5 web servers around the clock for a product that has existed for two years, and a separate report job that runs for 30 minutes a week and can be safely restarted. Which discount idea (commitment or Spot) suits each, and why?
Show answer
The 5 web servers are steady, long-running load, so a commitment (Reserved Instances or Savings Plans) fits: they will use the committed amount every hour. The weekly report job is short, flexible, and restartable, so it tolerates Spot interruptions and can use spare capacity at a discount. A commitment would be mostly unused for the job.