Cloud Computing Tutorial · Cloud Basics · Lesson 4 of 24
Cloud Pricing Models
On-demand, reserved capacity and savings plans, spot instances and free tiers, and how to estimate a monthly bill.
How you pay
| Model | Commitment | Discount | Good for |
|---|---|---|---|
| On-demand | None | - | Spiky or short-lived work, experiments |
| Savings plans / reserved instances (Azure reservations, Google committed use discounts) | 1 or 3 years | Large | Steady baseline usage |
| Spot (Azure Spot VMs, Google Spot VMs) | None; can be interrupted | Up to about 90% | Batch jobs, CI runners, stateless workers |
| Sustained-use discounts (Google Cloud) | None | Automatic for long-running VMs | Steady usage on Google Cloud |
Spot capacity can be taken back with short notice (two minutes on AWS, about 30 seconds on Azure and Google Cloud), so only use it for work that can be interrupted and retried.
What you're charged for
- Compute per second or hour, storage per GB-month, requests for some services.
- Data transfer: traffic out to the internet, between regions and often between zones. Inbound is usually free. This surprises many teams.
- Managed-service units (load balancer capacity units, database I/O, function invocations and GB-seconds).
HOURS = 730 # hours in an average month
on_demand_rate = 0.096 # example: a 2 vCPU / 8 GB instance, USD per hour
plans = {"on-demand": 1.0, "3-year savings plan": 0.45, "spot (when available)": 0.30}
baseline, peak_extra, peak_hours = 6, 10, 120 # 6 instances always on, 10 more during peaks
for name, factor in plans.items():
cost = baseline * HOURS * on_demand_rate * factor
print(f"baseline on {name:22}: ${cost:8,.2f} / month")
mix = baseline * HOURS * on_demand_rate * 0.45 + peak_extra * peak_hours * on_demand_rate
print(f"smart mix (plan for baseline, on-demand for peaks): ${mix:,.2f} / month")
Output
baseline on on-demand : $ 420.48 / month baseline on 3-year savings plan : $ 189.22 / month baseline on spot (when available) : $ 126.14 / month smart mix (plan for baseline, on-demand for peaks): $304.42 / month
Use the providers' calculators (AWS Pricing Calculator, Azure Pricing Calculator, Google Cloud Pricing Calculator) before building, and budgets with alerts after.
Test yourself
Which pricing option fits a nightly batch job that can be safely retried if interrupted?
Spot instancesA 3-year reservationDedicated hostsOn-demand only, always
Show answer
Answer: Spot instances
Interruptible, retryable work is ideal for the deep discounts of spot capacity.