Commitments and optimization
Start with measured waste
A bookstore pays for compute every hour, whether customers arrive or not. Its team must lower cost per completed order without weakening latency, availability or recovery targets. In this lesson, compare reversible usage optimization with contractual rate optimization, calculate utilization and coverage separately, and test downside demand before proposing any commitment. All prices are fictional USD examples, not current quotes. No purchases or real infrastructure changes are required.
Prerequisites: unit economics, capacity planning and recovery objectives. First collect a representative time series of demand, CPU, memory, IOPS, latency and error rate. Record seasonality and known product changes. A low average CPU does not prove a smaller instance can serve peak memory or latency needs.
Optimize usage before rates
| Lever | Evidence to inspect | Guardrail |
|---|---|---|
| Rightsize compute | Peak CPU, memory, network and IOPS | Test latency and failover under load |
| Schedule nonproduction | Owner, working hours and restart dependencies | Preserve data, backups and emergency access |
| Autoscale | Queue depth, request rate and startup lag | Minimum ready capacity and maximum spend alarm |
| Remove idle resources | Owner, dependency and last use | Approved retention and reversible cleanup |
| Tier storage | Age, access pattern and restore needs | Retrieval latency, minimum duration and recovery cost |
For example, four development VMs at a fictional $0.20/hour run 720 hours each, costing $576. Running each 160 hours costs $128 for compute alone, a modeled $448 reduction. Persistent disks, snapshots, IPs, monitoring and restart work may remain billable. Validate the entire workload, not just its VM line.
Account for regional rates, cross-zone and internet egress, storage requests and retrieval, NAT gateway time and bytes, logging ingestion and retention, snapshot growth, public IPv4 addresses, managed control planes and GPU/AI charges. For example, 300 GB of transfer at $0.08/GB plus 100 GB of NAT processing at $0.04/GB is $28 before hourly NAT fees. These may be separate charges on the same traffic. A cheaper compute region can be more expensive end-to-end or violate residency/latency constraints.
Rate options and provider scope
| Option | Suitable pattern | Risk |
|---|---|---|
| On-demand | Uncertain or short-lived use | Higher modeled unit rate |
| Interruptible / Spot | Checkpointable batch with fallback | Capacity withdrawal and rework |
| Resource reservation discount | Stable matching usage | Scope mismatch and unused commitment |
| Spend commitment discount | Stable eligible spend | Minimum spend, duration and exclusions |
AWS Savings Plans apply to eligible usage under a spend commitment; EC2 Spot can be interrupted and is not covered by Savings Plans. Azure reservations and savings plans differ in eligible resources and scope. Google Cloud offers resource-based and flexible spend-based committed use discounts (CUDs), subject to product-specific eligibility. A capacity reservation is not necessarily a discount, and a discount is not necessarily capacity assurance. Check exact term, currency, scope, cancellation and sharing rules. Do not equate providers' discounts, or assume unused commitments can be transferred or canceled.
For Spot, estimate total completed work cost, including retries, checkpoints, data transfer and fallback. An interrupted job may have to repeat work. A low rate alone cannot guarantee either cost savings or completion time.
Work a fictional hourly commitment model
Assume a single interchangeable unit of eligible compute. On-demand rate p = $0.10/unit-hour, commitment rate r = $0.07/unit-hour, reserved quantity q = 10 units. Every hour you owe q × r = $0.70 regardless of use. Demand d above q is on-demand. Hourly cost = q × r + max(d − q, 0) × p. On-demand-only cost = d × p. This resource-unit model is intentionally not an actual provider spend-plan algorithm.
| Scenario | Demand units | On-demand | Commitment + excess | Difference (on-demand minus commitment) |
|---|---|---|---|---|
| Baseline | 10 | $1.00 | $0.70 | $0.30 |
| Peak | 14 | $1.40 | $1.10 | $0.30 |
| Downside | 4 | $0.40 | $0.70 | −$0.30 |
Utilization = min(d,q)/q; coverage = min(d,q)/d. At peak, utilization is 100%, coverage is 10/14 ≈ 71.43%; at downside, utilization is 40%, coverage is 100%. If q or d is zero, the corresponding ratio is undefined. Provider dashboards often measure equivalent monetary spend instead of these homogeneous units. Compare only like denominators. When demand is below q, break-even demand is q × r/p = 7 units; at 7 both plans cost $0.70. Unused capacity cannot be moved between hours in this example.
Sensitivity and approval
Suppose baseline, peak and downside each occur for one hour. On-demand cost is $2.80; committed cost is $2.50, a modeled $0.30 difference. Total commitment utilization is (10+10+4)/30 = 80%; usage coverage is 24/28 ≈ 85.71%. If downside instead occurs twice as often as the other scenarios combined (four downside hours, one baseline, one peak), on-demand costs $4.00 and commitment costs $4.60. The modeled difference becomes negative $0.60. Annual extrapolation requires a justified hourly demand distribution, not multiplication of a single favorable day.
Compare smaller quantities, contract duration, eligible scope, migration plans, opportunity cost, exchange exposure and downside tolerance. Use finance and procurement approval before any actual contractual decision. A recommendation is evidence for discussion, not permission to buy. Re-measure after rightsizing, scheduling or moving workloads, because those changes reduce the stable commitment base.
Checkpoint and practice
Calculate costs at demand 7 and 12; explain why high coverage can coincide with low utilization. Identify three noncompute charges that remain after a development VM stops. Describe one performance or recovery condition that must pass before lowering capacity. Answers: demand 7 ties at $0.70; demand 12 costs $1.20 on-demand versus $0.90 committed; storage, snapshots and public IP charges can persist. An acceptable condition is a tested restore inside the recovery-time objective. Consult the AWS, Azure and Google Cloud source register for product-specific details.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Commitments and optimization — knowledge check
Choose the best answer for each offline scenario.
What should precede a long-term commitment proposal?
At demand 4 with commitment quantity 10, what is utilization?
At demand 14 and quantity 10, what is coverage?
At demand 7, with p=0.10, r=0.07, q=10, which is cheaper?
What matters for interruptible batch compute?