Platform Unit Economics and Cost Controls
A cloud bill arrives as one number, broken down by service and resource type. A platform team that runs shared clusters, pipelines, observability stores, and recovery capacity needs a different number: what does one unit of useful work cost, who is responsible for it, and what happens to that cost when demand, reliability targets, or purchasing terms change? This article builds that number step by step. It covers how to allocate cost to owners, how to choose a workload unit, what capacity and reliability add to the cost of a unit, how commitment discounts move risk from the vendor to you, and how to measure and tune without damaging the service.
The article assumes general computer science and programming knowledge, including basic arithmetic modeling. It also builds on Incident Response, Recovery, and Disaster Exercises, which covered incident roles, recovery objectives, restore tests, and evidence-based incident analysis. The only idea carried over is that recovery capability has to be exercised to be believed. In this article the same capability appears as a cost line: standby capacity, restore drills, and retained evidence all consume money. The cost arithmetic below stands on its own and does not depend on the details of that article.
All dollar figures in this article are assumptions chosen to make the arithmetic easy to follow. They are not prices from any provider and not measurements of any real system. The results come from short Python models that use only the standard library and create no cloud resources. Each model is listed next to the output it produced, and the text explains what the output shows. The noisy traces are generated with fixed random seeds, which the listings include.
What a cost number has to answer
FinOps Foundation’s Unit Economics capability describes the purpose as relating technology spending to the business outcomes it supports. The framework separates two kinds of unit metric: resource efficiency metrics, such as cost per GB, per vCPU, or per token, and business metrics, such as cost per customer or per transaction. It also cautions against forcing comparison between unrelated products, and suggests that a trend over time within a defined scope is usually the most actionable view.
That guidance has a practical consequence for a platform team. A unit cost is a ratio, and a ratio has a numerator and a denominator that can each be wrong in different ways.
- The numerator is the cost you attribute to a workload. Its errors come from allocation: missing tags, shared costs spread by an arbitrary rule, idle capacity assigned to the wrong party.
- The denominator is the unit of work. Its errors come from choosing a unit that does not drive cost, mixing unlike work under one name, or measuring the unit differently from one month to the next.
- The interpretation is where decisions go wrong: reading a falling average cost as an efficiency gain when it is only fixed cost spread over more traffic.
The sections that follow take the numerator first (allocation), then the denominator (workload units), then the two cost drivers that platform teams control least obviously (capacity headroom and commitments), and finally the measurement loop that ties them together.
Cost allocation: from one bill to accountable owners
Cost attribution asks who caused a cost; allocation decides who bears it. The FinOps Foundation’s Allocation capability describes it as apportioning cost to responsible parties using account structure, tags, labels, and other metadata, and lists three strategies that must be decided separately: how costs map to organizational units, how resources are labeled, and how each category of shared cost is handled.
Accounts and tags give you the first mapping
The coarsest allocation boundary is the account or subscription: a dedicated account has one bill and an owner. It breaks down when a product spans accounts, when a shared account hosts several teams, or when ownership changes. Tags and labels cover those cases, and a cost allocation tag only helps if three conditions hold: something applied it, the billing system was told to use it, and the value means what the reader thinks.
AWS documents the second condition concretely. User-defined and AWS-generated cost allocation tags must be activated separately before they appear in Cost Explorer or the cost allocation report, and a tag can take up to 24 hours to appear. The cost allocation report includes tagged and untagged resources and reconciles with the bill total at the end of the billing cycle. A backfill can retroactively apply the current activation status for up to twelve months, but the documentation states that the tag must historically have been assigned to the resource for backfilled cost data to exist. In other words, activation is not retroactive tagging: a resource that carried no tag in March has no March tag value, however you backfill.
Other providers have their own mechanisms, so check the one you use. The portable lessons are these:
- Untagged is the default state of a resource, not a malfunction, so the share of cost that cannot be allocated is a metric you track. The FinOps Allocation capability names the percentage of costs that cannot be categorized and allocated directly as a measure worth watching, and notes that perfect consistency is rarely reached; the goal is a level of allocation good enough for decisions.
- Enforce at creation if you can. A required tag in the provisioning template or an admission check is cheaper than a quarterly cleanup. The policy as code approach is one way to make that check reviewable.
- Keep the required set small. Each required key is another thing a template must set and a human must understand. Team, service, and environment cover many allocation questions; more keys invite inconsistent values.
Allocating a shared Kubernetes cluster
Accounts and tags work on resources the provider bills for. Pods are not billed; the nodes under them are. A shared cluster therefore needs an allocation rule that turns node cost into per-workload cost. The OpenCost specification gives one explicit model, and it is worth learning even if you use a different tool because it shows the decisions any model must make.
OpenCost decomposes total cluster cost into workload cost, idle cost, and overhead. For CPU and RAM, a workload’s cost is the amount of the resource, times the duration, times the hourly rate, where the amount is the greater of what the workload requested and what it used. The specification explains that this rule assigns the cost that kube-scheduler reserved for the workload while still charging for overuse. Idle cost is the difference between the cost of the underlying assets and the cost assigned to workloads. Shared cost can be spread uniformly, proportionally to consumption, or by a custom metric such as network egress.
The reason requests matter is how Kubernetes uses them. The scheduler places a pod on a node based on its requests, and the kubelet reserves at least the requested amount; containers may use more than they requested if the node has spare capacity. CPU limits are enforced by throttling, and memory limits by out-of-memory kills when the kernel detects pressure. So a request is a claim on capacity that other pods cannot use, whether or not the pod uses it. That is the argument for charging at least the request: the reservation is what caused the node to exist.
To see the difference between rules, here is a small calculation. The cluster is three nodes of eight vCPU at an assumed \$0.40 per node-hour, which gives \$876 per 730-hour month and \$0.05 per core-hour. Only CPU is modeled. Four workloads have the following assumed inputs, which are assumptions made for this article.
| Workload | CPU requested (cores) | Average CPU used (cores) | Requests served per month |
|---|---|---|---|
| checkout | 6.0 | 3.0 | 90,000,000 |
| search | 8.0 | 8.5 | 140,000,000 |
| batch | 4.0 | 0.8 | 6,000,000 |
| internal-tools | 2.0 | 0.3 | 1,500,000 |
Each rule multiplies a core count by \$0.05 and by 730 hours: the requested cores, the used cores, or the larger of the two. Idle is the cluster cost minus the allocated sum, and cost per million requests is allocated cost divided by requests in millions. The model below applies the three rules and then spreads the idle cost of the max rule proportionally to workload cost. Its constants are reused by the headroom and commitment models later in the article.
import math, random
# Allocation of a shared cluster. All numbers are assumptions.
NODES, NODE_CPU, NODE_USD_H = 3, 8.0, 0.40 # assumed node price, USD/hour
HOURS = 730
cluster_cost = NODES * NODE_USD_H * HOURS
cpu_rate = cluster_cost / (NODES * NODE_CPU) / HOURS # USD per core-hour (CPU only, simplified)
# (team, CPU requested, average CPU used, requests served per month)
wl = [("checkout", 6.0, 3.0, 90_000_000),
("search", 8.0, 8.5, 140_000_000),
("batch", 4.0, 0.8, 6_000_000),
("internal-tools", 2.0, 0.3, 1_500_000)]
def alloc(name, f):
costs = {t: f(r, u) * cpu_rate * HOURS for t, r, u, _ in wl}
workload = sum(costs.values())
idle = cluster_cost - workload
print(f"\n[{name}] cluster=${cluster_cost:,.2f} workload=${workload:,.2f} idle=${idle:,.2f} ({idle/cluster_cost:.1%})")
for t, r, u, n in wl:
print(f" {t:15s} ${costs[t]:8.2f} per 1M req ${costs[t]/(n/1e6):8.2f}")
return costs, idle
print(f"cpu_rate = ${cpu_rate:.5f} per core-hour; cluster = ${cluster_cost:.2f}/month")
alloc("by request", lambda r, u: r)
alloc("by usage", lambda r, u: u)
c, idle = alloc("max(request, usage)", lambda r, u: max(r, u))
# distributing idle proportionally to workload cost
tot = sum(c.values())
print("\n[max(request,usage) + idle spread proportionally]")
for t, r, u, n in wl:
full = c[t] + idle * c[t] / tot
print(f" {t:15s} ${full:8.2f} per 1M req ${full/(n/1e6):8.2f}")
The output has one block per rule, plus a final block that adds each workload’s proportional share of idle cost to the max rule. Any line can be checked by hand from the table above.
cpu_rate = $0.05000 per core-hour; cluster = $876.00/month
[by request] cluster=$876.00 workload=$730.00 idle=$146.00 (16.7%)
checkout $ 219.00 per 1M req $ 2.43
search $ 292.00 per 1M req $ 2.09
batch $ 146.00 per 1M req $ 24.33
internal-tools $ 73.00 per 1M req $ 48.67
[by usage] cluster=$876.00 workload=$459.90 idle=$416.10 (47.5%)
checkout $ 109.50 per 1M req $ 1.22
search $ 310.25 per 1M req $ 2.22
batch $ 29.20 per 1M req $ 4.87
internal-tools $ 10.95 per 1M req $ 7.30
[max(request, usage)] cluster=$876.00 workload=$748.25 idle=$127.75 (14.6%)
checkout $ 219.00 per 1M req $ 2.43
search $ 310.25 per 1M req $ 2.22
batch $ 146.00 per 1M req $ 24.33
internal-tools $ 73.00 per 1M req $ 48.67
[max(request,usage) + idle spread proportionally]
checkout $ 256.39 per 1M req $ 2.85
search $ 363.22 per 1M req $ 2.59
batch $ 170.93 per 1M req $ 28.49
internal-tools $ 85.46 per 1M req $ 56.98
Read the three blocks as three different statements about responsibility.
- Allocation by request charges every team for the capacity it reserved. Search used more than it requested (8.5 cores against 8.0), so allocating by request alone undercharges it by \$18.25 and pushes that cost into idle.
- Allocation by usage charges what teams actually burned. Idle jumps to 47.5 percent of the cluster because reserved but unused capacity has no owner. A team that over-requests pays nothing for it, so the rule gives no incentive to right-size, and the platform team absorbs a cost it did not cause.
- The max rule charges at least the reservation and also charges overuse. Idle falls to 14.6 percent, which is the capacity that no workload reserved or used: headroom and fragmentation.
The max rule is not a law of nature. It reflects a judgment that a reservation is a cost the reserver caused, and that is a choice you may want to explain to consumers before they see a bill. A workload that requests nothing, relies on limits, or runs as a burstable pod needs separate consideration; the Kubernetes documentation notes that if you set a limit without a request, the limit is used as the request unless an admission mechanism applies a default. That detail changes the allocation silently, so check how your cluster’s defaults are applied.
Idle and shared costs need an explicit rule
Idle capacity is not waste by definition. Some of it is headroom you chose to keep for failures and spikes, which the capacity section below prices. Some is fragmentation: the leftover cores on each node that no pod fits into. Some is true over-provisioning. The OpenCost model reports one number for idle and does not tell you which of the three it is; you have to look at node utilization and scheduling data to separate them.
Once idle is visible, you must decide who carries it. Three rules are common, and they distribute the same \$127.75 differently:
- The platform team carries idle in its own budget. That keeps consumer bills tied to reservations, and makes the platform team accountable for cluster efficiency, which it largely controls.
- Idle is spread uniformly across tenants. That is easy to explain and rewards small tenants unfairly, since a tenant with a tiny footprint pays the same idle share as a large one.
- Idle is spread proportionally to each tenant’s allocated cost. That keeps ratios between tenants stable. The last block of the allocation results does this, which raised each workload’s cost by about 17 percent in this example: checkout moved from \$219.00 to \$256.39, and search from \$310.25 to \$363.22.
The FinOps Allocation capability also describes an “informed ignore” stance toward some shared costs: budget them centrally instead of charging them back, because the effort and conflict of allocating them can exceed the benefit. That is a legitimate choice for small shared items. It is a poor one for a cost that is large, growing, and driven by a few consumers.
Showback and chargeback differ by formality: showback reports the cost to the responsible group, while chargeback moves it into their budgets. The choice affects how accurate allocation must be. A showback figure that is 10 percent off starts a conversation; a chargeback figure that is 10 percent off starts a dispute with finance. Start with showback until the allocation rules are stable enough to defend.
How allocation fails
- Tag drift. Values change spelling (
payments,Payments,payments-team), and a report groups them as three owners. Normalize values in the billing pipeline and validate against a list of known owners. - Orphaned resources. A resource outlives the project that created it. Allocation to a defunct owner is accurate and useless. Pair allocation with an owner-review process.
- Cost that has no tag-able resource. Support charges, data transfer between services, or a shared observability platform need a shared-cost rule, not a tag.
- Allocation that changes behavior in unwanted ways. Charging by request reduces over-requesting, and can also push teams to set requests below their real peak, converting a cost problem into a reliability problem. This is why the measurement loop later pairs unit cost with service objectives.
- Rule changes that break trends. If you change from usage-based to max-based allocation in the middle of a quarter, the reported cost of every team moves without any change in behavior. Version the allocation rule and restate history, or annotate the break.
In a shared cluster, allocation also interacts with isolation. Where multi-tenancy is by namespace, a noisy neighbor can degrade one tenant’s performance without being visible in its own cost line. Allocation tells you who paid for capacity; it does not tell you who was affected by whose consumption. Use the isolation and quota mechanisms from the shared-cluster design for that question.
Workload units: choosing the denominator
A unit cost is useful when the unit is the thing that makes cost change. The platform usually serves many kinds of work, so the choice of unit is a modeling decision that deserves the same care as the allocation rule.
Candidate units
| Unit | Good for | Where it misleads |
|---|---|---|
| Requests served | Request-driven services with similar request cost | Requests of very different cost are counted as equal; background work has no requests |
| Active tenants or users | Costs that scale with accounts, such as per-tenant namespaces or dashboards | Ignores how heavily each one uses the platform |
| Deployments or pipeline runs | CI/CD capacity | A run that executes a ten-second lint and one that runs a two-hour integration suite look the same |
| Build or test minutes | CI compute | Waiting and queue time are invisible; minutes can rise because tests improved |
| Stored GB-months | Registries, artifact stores, logs, backups | Retention and access patterns decide the real cost |
| Ingested metric series, log GB, or spans | Observability platforms | Cardinality and verbosity are chosen by producers, not by traffic |
| Tokens | Model-serving or AI features | Prompt length, caching, and model choice change cost at constant request count |
The allocation output shows how a unit can mislead. Per million requests, batch costs \$24.33 and internal-tools costs \$48.67, against about \$2 for the request-driven services. Those numbers are not evidence of inefficiency; they come from using a request-count denominator for workloads whose cost is driven by job runtime and by a reservation the team made. A batch service is better described by cost per job or per processed GB. An internal tool with 1.5 million requests a month might still need two cores reserved for availability. Dividing both by request count produces large ratios that invite the wrong conversation.
Rules for a usable unit:
- Cost must move with the unit. If doubling the unit leaves the bill unchanged, the unit is not a driver for that cost. Test it against several months of data before you adopt it.
- The unit must be defined once and measured the same way. Say what counts: all requests or only successful ones, with or without health checks, synthetic traffic included or not. A change in definition can move the ratio more than any engineering work.
- One workload may need more than one unit. Request-driven cost and storage cost do not share a driver. Report them separately before you sum them.
- Stay inside a comparable scope. The FinOps guidance against comparing unrelated products applies directly: do not rank the batch platform against the API platform on cost per request.
Average cost, marginal cost, and fixed cost
Most platform cost has a fixed part that does not move with traffic: a minimum cluster size, a control plane, a standby environment, monitoring baselines. If you divide total cost by units, growth looks like efficiency because the fixed part is spread thinner. To separate the two, fit cost against the unit over several periods. The following model generates twelve months of cost from an assumed relationship, \$600 fixed plus \$1.10 per million requests plus noise, fits a line to the result, and shows what the average hides.
import random, statistics
random.seed(11)
# Fixed vs variable cost; average vs marginal cost per unit (assumed generating model)
FIXED, VAR = 600.0, 1.10 # USD/month fixed, USD per million requests (assumptions)
months = []
for m in range(12):
req = 60 + m * 15 + random.uniform(-8, 8) # millions of requests
cost = FIXED + VAR * req + random.gauss(0, 12)
months.append((req, cost))
n = len(months)
mx = sum(r for r, _ in months) / n; my = sum(c for _, c in months) / n
slope = sum((r - mx) * (c - my) for r, c in months) / sum((r - mx) ** 2 for r, _ in months)
icpt = my - slope * mx
print(f"{'month':>5} {'M req':>7} {'cost':>8} {'avg $/M':>8}")
for i, (r, c) in enumerate(months, 1):
print(f"{i:5d} {r:7.1f} {c:8.2f} {c/r:8.2f}")
print(f"fit: cost = {icpt:.1f} + {slope:.3f} * requests(M) (generating values: {FIXED}, {VAR})")
print(f"average $/M req: first month {months[0][1]/months[0][0]:.2f}, last month {months[-1][1]/months[-1][0]:.2f}; marginal ~{slope:.2f}")
month M req cost avg $/M
1 59.2 639.80 10.80
2 74.5 671.90 9.02
3 90.1 692.60 7.68
4 105.2 711.71 6.77
5 122.1 735.71 6.03
6 131.9 739.90 5.61
7 143.5 764.55 5.33
8 157.7 756.26 4.80
9 187.7 823.54 4.39
10 196.8 812.69 4.13
11 204.5 839.62 4.11
12 218.0 841.13 3.86
fit: cost = 576.6 + 1.248 * requests(M) (generating values: 600.0, 1.1)
average $/M req: first month 10.80, last month 3.86; marginal ~1.25
The average cost per million requests fell by about 64 percent over the year while nothing improved in the system: the generating model had constant fixed and variable parts by construction. The fitted slope of about \$1.25 per million requests is the marginal cost, and it is close to, but not equal to, the true \$1.10 because twelve noisy points give an imprecise estimate. Two things follow. First, the slope is an estimate with uncertainty, so quote it as roughly \$1.1 to \$1.3 rather than to the cent. Second, the intercept answers a different question: what does it cost to operate the platform at near-zero traffic? That fixed part is a decision about minimum service level, not a consequence of any consumer’s behavior. Report it separately and decide who funds it.
This fit assumes a linear relationship and a stable fixed part. Step costs break it: adding a node, a zone, or a new shard raises cost in jumps. When demand crosses such a threshold, the marginal cost for that period is much higher than the slope. Look at residuals and the steps in your data before relying on a straight line.
Capacity and reliability costs
Capacity and reliability are not an overhead added after the workload is sized; they are part of what a unit of service costs. Choosing a headroom policy changes the cost per unit as much as any tuning.
Headroom and failure domains
Capacity planning is deciding how much of a resource to provision. The cost implication of a reliability requirement shows up when you write the requirement in terms of what must still work after a failure. The model below gives the nodes needed to serve an assumed peak of 18 cores under four policies, using the node size and price from the allocation model. The last column of its output divides cost by an assumed 237.5 million requests per month. The target utilization is the fraction of node CPU you are willing to fill at peak. A policy that survives the loss of one of three zones requires the remaining two zones to carry the full peak.
# Reliability headroom (reuses NODE_CPU, NODE_USD_H, and HOURS from the allocation model)
def nodes_needed(peak, target_util, zones, survive_zone_loss):
per_zone_cap = NODE_CPU * target_util
if zones == 1 or not survive_zone_loss:
return math.ceil(peak / per_zone_cap)
# after losing one zone, remaining (zones-1) zones must carry the peak
per_zone = math.ceil(peak / per_zone_cap / (zones - 1))
return per_zone * zones
req_per_month = 237_500_000
for label, util, z, s in [("1 zone, 80% target util", .8, 1, False),
("1 zone, 60% target util", .6, 1, False),
("3 zones, 80% util, survive 1 zone loss", .8, 3, True),
("3 zones, 60% util, survive 1 zone loss", .6, 3, True)]:
n = nodes_needed(18.0, util, z, s)
cost = n * NODE_USD_H * HOURS
print(f"{label:42s} nodes={n:2d} cost=${cost:8.2f}/mo per 1M req=${cost/(req_per_month/1e6):.3f}")
--- headroom: nodes needed for a peak of 18.0 cores ---
1 zone, 80% target util nodes= 3 cost=$ 876.00/mo per 1M req=$3.688
1 zone, 60% target util nodes= 4 cost=$ 1168.00/mo per 1M req=$4.918
3 zones, 80% util, survive 1 zone loss nodes= 6 cost=$ 1752.00/mo per 1M req=$7.377
3 zones, 60% util, survive 1 zone loss nodes= 6 cost=$ 1752.00/mo per 1M req=$7.377
In this model, surviving the loss of a zone doubles the cost of the single-zone, 80 percent policy. The reason is arithmetic: if three zones must carry the peak with two of them, each zone must be sized for half the peak, so total capacity is 1.5 times the single-zone requirement before rounding to whole nodes. Rounding to whole nodes added the rest in this example. The two three-zone rows come out equal only because rounding made each zone two nodes in both cases; with a different peak they would differ.
Two cautions keep this from becoming a rule of thumb. The model counts only CPU; real placement must also fit memory, pod anti-affinity, storage that is tied to a zone, and system overhead. And it prices one failure scenario, losing one zone. Another requirement, such as tolerating a node-pool upgrade at peak or absorbing a retry storm, would produce another number. The point of writing the requirement as a scenario is that you can price it and then discuss whether the business wants to pay.
Load shedding is the alternative to buying capacity for every scenario: deliberately rejecting part of the load so the rest is served. It trades cost for degraded service in a defined situation, so it belongs in the same cost conversation. Whether to buy headroom or shed load is a question about the value of the requests you would reject, which engineering cannot answer alone.
How much reliability is worth
The Google SRE book’s chapter on embracing risk states that an incremental improvement in reliability may cost a hundred times more than the previous increment, through both infrastructure and engineering time diverted from features. It gives a worked comparison: for a service earning \$1 million, improving availability from 99.9 to 99.99 percent protects about 0.09 percent of revenue, or \$900, so spending more than that on the extra nine is not justified by revenue alone. The book is clear that this applies where reliability maps to revenue; for other services, it suggests comparing error rates against the background error rates users already see.
This arithmetic is a good template, with two limits. It values lost revenue and ignores cost that revenue does not capture, such as regulatory obligations, safety, or loss of trust that persists beyond an outage. And it treats availability as the only dimension. Use it to force the question what is the most we should pay for this objective, and do not treat it as a full valuation.
An error budget connects the objective to day-to-day decisions: the allowed failure fraction under a service objective is the complement of the target, so a 99.9 percent target allows 0.1 percent of eligible events to fail within the window. A tighter objective means less allowed failure and typically more spending on redundancy and process. That makes the objective a cost parameter. When you review unit cost, review the objective alongside it. A service whose objective is stricter than its consumers need pays for the difference every month.
Recovery capability has a cost too
The prerequisite article treated recovery as something to validate by restoring from backups and analyzing incidents from evidence. Each of those practices has a cost profile:
- Backups and replicas cost storage and cross-zone or cross-region transfer, and the amount depends on retention and change rate.
- A restore test costs the compute and storage of a temporary environment plus staff time, and its value depends on how often you run it and how realistic the data is.
- A standby environment costs whatever you keep running. If it is cold, recovery time is longer; if it is warm, you pay continuously.
- Retained logs, traces, and metrics support incident analysis but accumulate cost with volume and retention. Metric cost depends on metric cardinality, the number of distinct label combinations, which producers decide when they add a label. A label with an unbounded value, such as a user ID, multiplies series and cost without improving most diagnoses.
You do not have to minimize these. You have to be able to say what each recovery-related capability costs per month and which failure it covers. A restore test that is never run does not reduce risk, and does not need to be paid for either.
Commitment risk
A commitment discount trades flexibility for a lower rate. The fact that makes it a risk and not a free discount is that the obligation continues when usage falls.
What a commitment is
AWS Savings Plans, as documented, provide lower prices than On-Demand in exchange for a commitment to a specified amount of compute usage, measured per hour, over a one or three year term. The payment options are all upfront, partial upfront, or no upfront. The documentation describes how a plan applies: it covers eligible usage in each hour, starting with the usage that would earn the highest discount percentage, until the hourly commitment is exhausted, and remaining usage is charged at On-Demand rates. It also states that each hour’s commitment can only be used within that hour and cannot be carried over. A purchase can be returned only in a narrow case: an hourly commitment of \$100 or less, purchased within the last seven days and in the same calendar month, subject to a return limit.
Other providers and other products (reserved instances, committed use contracts, enterprise agreements) differ in flexibility, so read the one you buy. The commitment discount glossary entry summarizes how eligibility determines flexibility. What carries across is the structure: a fixed payment per period, coverage of usage up to a level, and exposure to usage that falls below it.
The arithmetic of over-commitment
Suppose the discount on committed usage is 30 percent and the commitment is expressed as an hourly amount at On-Demand-equivalent value. Each hour you pay the committed amount times 0.7, whether or not you use it. Usage above the commitment is billed On-Demand. Two consequences follow.
- In any single hour, the commitment pays off only if usage is at least 70 percent of the committed amount, since 0.7 is the fraction you pay regardless. Below that, you would have paid less On-Demand.
- Over a month, what matters is the shape of the hourly curve, because each hour is settled separately. A diurnal pattern with a deep trough means a commitment near the average is already above the usage in the trough hours.
The model below uses a hypothetical 30-day hourly spend trace with a daily cycle and noise (mean about \$10 per hour, with a minimum near \$5.70 and a maximum near \$14.70), then evaluates commitment levels under the forecast and under demand 30 percent lower or higher. The percentages are the total paid relative to paying On-Demand for that same usage; negative is savings. The trace is invented.
# Commitment on a hypothetical hourly spend trace (reuses HOURS and math/random)
random.seed(7)
def trace(days, base, amp, growth=0.0):
out = []
for d in range(days):
scale = 1 + growth * d / days
for h in range(24):
diurnal = 1 + amp * math.sin((h - 6) / 24 * 2 * math.pi)
out.append(max(0.0, base * scale * diurnal * (1 + random.uniform(-.05, .05))))
return out
DISC = 0.30 # assumed discount on committed spend (e.g., 30%)
def cost_with_commit(tr, commit_od):
# commit_od: hourly commitment expressed in on-demand-equivalent usage.
# You pay commit_od*(1-DISC) every hour; usage up to commit_od is covered; excess at on-demand.
paid = 0.0
for u in tr:
paid += commit_od * (1 - DISC) + max(0.0, u - commit_od)
return paid
fc = trace(30, 10.0, 0.4) # forecast month
od = sum(fc)
print(f"forecast month: on-demand ${od:,.0f}, min ${min(fc):.2f}/h, mean ${od/len(fc):.2f}/h, max ${max(fc):.2f}/h")
levels = [0, 4, 6, 8, 10, 12]
shrunk = [u * 0.7 for u in fc] # demand 30% lower than forecast
grown = [u * 1.3 for u in fc]
print(f"{'commit($/h OD-equiv)':>22s} {'forecast':>10s} {'demand-30%':>11s} {'demand+30%':>11s} (vs on-demand of each)")
for L in levels:
row = []
for tr in (fc, shrunk, grown):
c = cost_with_commit(tr, L); row.append(f"{c/sum(tr)-1:+.1%}")
print(f"{L:22.1f} {row[0]:>10s} {row[1]:>11s} {row[2]:>11s}")
print("\nbreak-even: commit pays off in an hour only if usage >= (1-disc) * commit =", (1-DISC), "of commit")
cov = lambda tr, L: sum(min(u, L) for u in tr)/sum(tr)
util = lambda tr, L: sum(min(u, L) for u in tr)/(L*len(tr))
for L in (6, 8, 10):
print(f"commit {L}: coverage(forecast)={cov(fc,L):.1%} utilization(forecast)={util(fc,L):.1%} | utilization(demand-30%)={util(shrunk,L):.1%}")
--- commitment on a hypothetical hourly spend trace ---
forecast month: on-demand $7,185, min $5.73/h, mean $9.98/h, max $14.68/h
commit($/h OD-equiv) forecast demand-30% demand+30% (vs on-demand of each)
0.0 -0.0% -0.0% -0.0%
4.0 -12.0% -17.2% -9.2%
6.0 -18.0% -19.3% -13.9%
8.0 -19.6% -13.6% -18.3%
10.0 -17.2% +0.3% -19.7%
12.0 -11.6% +20.2% -18.5%
break-even: commit pays off in an hour only if usage >= (1-disc) * commit = 0.7 of commit
commit 6: coverage(forecast)=60.1% utilization(forecast)=99.9% | utilization(demand-30%)=92.4%
commit 8: coverage(forecast)=75.8% utilization(forecast)=94.5% | utilization(demand-30%)=81.9%
commit 10: coverage(forecast)=87.4% utilization(forecast)=87.2% | utilization(demand-30%)=69.8%
Coverage is the share of usage covered by the commitment. Utilization is the share of the committed amount actually used. They answer different questions: coverage says how much of your spend gets the discount, and utilization says how much of what you bought you used.
Reading the table:
- Under the forecast, the best commitment in this trace is about \$8 per hour, with a 19.6 percent saving. A commitment equal to the mean usage (\$10) saves less, 17.2 percent, because the trough hours leave part of it unused.
- The savings curve is asymmetric. A commitment of \$6 per hour is within about six percentage points of the best level in all three scenarios (1.6, 0.0, and 5.8 points), while a \$12 commitment saves 11.6 percent if the forecast is right and costs 20.2 percent more than On-Demand if demand falls 30 percent.
- A commitment near the mean is a bet on the forecast. At \$10, a 30 percent demand drop erases the saving entirely (+0.3 percent).
- Utilization falls faster than coverage rises as the commitment grows. A 99.9 percent utilization at \$6 is the sign of a commitment sitting under the usage floor.
The simulation says nothing about your usage. What it demonstrates is that the downside of committing above the floor is larger than the upside of committing slightly below the best level, and that forecast error in one direction is much more costly than in the other. Whether the error distribution in your workload justifies a given level is a data question for your own billing history.
Reducing commitment risk
- Commit to a floor you can defend. Use the minimum sustained hourly usage over a long period and adjust for known projects. Raise the commitment in steps when the floor rises, not in a single large purchase.
- Stagger purchases and terms. Several smaller commitments that expire at different times limit how much can lapse or be stranded at once. The tradeoff is more purchases to manage.
- Check eligibility against your roadmap. A commitment tied to an instance family and region is stranded by a migration; a broader one gives up some discount for flexibility. Plan platform changes, such as a change of runtime or architecture, with the commitment calendar in view.
- Decide who holds the commitment risk. If the platform team buys the commitment and allocates the discounted rate to consumers, it holds the risk that consumers shrink. If consumers buy their own, they bear it but lose pooling. State the rule before the first purchase.
- Treat reliability scenarios as demand scenarios. Headroom that exists for zone failure is usage that a commitment can cover; headroom you hold on standby and rarely use is a commitment you pay for in both ways.
None of this recommends a purchase. The numbers in this article are assumptions, and whether to commit depends on prices, terms, forecast quality, and risk tolerance that this article cannot know.
Measurement and tuning
Allocation, units, headroom, and commitments give you parameters. Tuning is the process of changing them while keeping the service within its objectives and being able to show that the change helped.
A tuning loop
- Establish a baseline for a defined scope. Pick the unit, the allocation rule, and the period. Record the rule version. Compute unit cost and show its fixed and variable parts.
- Choose one change with a stated mechanism. For example, lower a service’s CPU request, change a retention period, or move a batch job to off-peak hours. Write down what you expect to happen to cost and to the service objective.
- Change one thing at a time where you can. Several simultaneous changes make attribution impossible, especially when traffic is also moving.
- Measure both cost and service indicators. A cost win accompanied by more errors, throttling, or restarts is a transfer of cost to users or on-call staff.
- Compare against the right baseline. Compare with a period of similar demand, or use a model of expected cost for the observed demand, such as the fitted line above, instead of comparing raw totals.
- Record the decision and revisit it. Reasons expire. A request that was right at one traffic level is wrong at another.
Example: sizing a request from usage data
The most common tuning change on a shared cluster is lowering an over-large CPU request. The model below generates a week of one-minute CPU samples for a service (a diurnal pattern, noise, and rare spikes; all synthetic, drawn from the same seeded generator as the monthly data above), prints percentiles, and prices three candidate requests under the max rule.
# Request sizing from usage samples (hypothetical per-minute CPU samples of one service, cores)
samples = []
for minute in range(7 * 24 * 60):
h = (minute // 60) % 24
base = 1.2 + 1.0 * (1 if 9 <= h < 18 else 0)
spike = random.random() < 0.002
samples.append(base * random.uniform(.85, 1.15) + (2.5 if spike else 0))
samples.sort()
def pct(p): return samples[int(p / 100 * (len(samples) - 1))]
print()
for p in (50, 90, 95, 99, 99.9, 100):
print(f"p{p:<5} {pct(p):.2f} cores")
print(f"mean {statistics.mean(samples):.2f} cores")
req_now = 6.0
rate = 0.05 * 730
for new in (req_now, pct(99) * 1.2, pct(100)):
print(f"request {new:.2f} cores -> ${new*rate:8.2f}/month; share of samples above request: {sum(s>new for s in samples)/len(samples):.4%}")
p50 1.31 cores
p90 2.35 cores
p95 2.44 cores
p99 2.52 cores
p99.9 3.82 cores
p100 4.73 cores
mean 1.58 cores
request 6.00 cores -> $ 219.00/month; share of samples above request: 0.0000%
request 3.02 cores -> $ 110.20/month; share of samples above request: 0.2480%
request 4.73 cores -> $ 172.61/month; share of samples above request: 0.0000%
The current request of 6 cores sits above the highest sample, so it costs \$219 per month under the max rule, and it exceeds the observed peak by 27 percent. A request of 1.2 times the 99th percentile (3.02 cores) cuts the allocation to \$110.20 but would be below the usage in 0.25 percent of the minutes, which is about 25 minutes in the week. Whether that is acceptable depends on what happens in those minutes. The Kubernetes documentation says CPU limits throttle and memory limits can lead to out-of-memory kills, so the harm depends on whether the service has limits, whether it is CPU-bound in those minutes, and how its latency objective is defined. Setting the request at the observed maximum (4.73 cores, \$172.61) removes sample exposure at 79 percent of the original cost.
The calculation does not decide the right number. It shows what to look at: the distribution, the rare spikes, and the cost of each choice. A week of data may miss a month-end job. Use a window that includes the periodic events you care about, and check what a spike does to the service before deciding that a spike is tolerable. For memory, be more conservative than for CPU: CPU contention slows work, while exceeding a memory limit can terminate the process.
Guardrails for the measurement itself
- Reconcile to the bill. Allocated cost plus unallocated cost must equal the invoice for the period. A report that does not reconcile cannot be trusted for unit cost.
- Track allocation coverage. If the unallocated share rises, a unit cost computed from allocated cost is falling for the wrong reason.
- Watch for double counting. Shared costs allocated to tenants and also charged to the platform line appear twice.
- Mind the dimensions of your own cost metrics. A cost dashboard with team, service, environment, and pod labels can create the cardinality problem it is trying to measure. Aggregate before you store, and keep high-cardinality detail for investigation.
- Pair unit cost with the objective. Report cost per unit next to the error budget burn, so a reduction that spends the budget is visible in the same view.
- Separate efficiency from demand and price changes. Unit cost can change because a provider changed rates, because a discount started or expired, or because traffic mix shifted. Decompose before you claim an engineering result.
What this method cannot tell you
A unit cost measures cost per unit of activity. It does not measure whether the activity is valuable, whether a team could do the work some other way, or how much developer time a platform capability saves. Those need different evidence, such as adoption data and developer feedback. Allocation also rests on rules that reasonable people dispute, and two defensible rules can give different answers, as the three blocks of allocation output show. Finally, the models here use CPU and a small set of assumptions. Real platforms have memory, storage, network, licenses, and people. Add a dimension when it is a material part of the bill, and say in the report what is excluded.
Putting the pieces together
A platform unit-economics report that supports decisions has five parts: the allocation rule and its version; the unit definitions; the fixed and variable split with its uncertainty; the cost of the reliability requirements the platform commits to, expressed as failure scenarios; and the commitment position, with coverage, utilization, and the demand fall that would make it a loss. Each part is cheap to compute from data you already have, and each can be wrong in ways that the others will not reveal. Publish the assumptions with the numbers, and revisit them when prices, architecture, or objectives change.
References
- FinOps Foundation: Unit Economics
- FinOps Foundation: Allocation
- OpenCost Specification
- Kubernetes documentation: Resource Management for Pods and Containers
- Google SRE Book: Embracing Risk
- AWS Savings Plans User Guide: What are Savings Plans?
- AWS Savings Plans User Guide: Understanding how Savings Plans apply to your usage
- AWS Savings Plans User Guide: Returning a purchased Savings Plan
- AWS Billing: Organizing and tracking costs using AWS cost allocation tags
- AWS Billing: Backfill cost allocation tags
Discover more from Insightful Data Lab
Subscribe to get the latest posts sent to your email.
