Skip to content
AI.info

MLOps

Capacity, Cost, Performance, and Sustainable ML Operations

Plan capacity and optimize latency, throughput, utilization, reliability, and environmental cost across training and serving workloads.

By the end you can

The cheapest request can create the most expensive product

Aggressive batching brings inference cost down. Average GPU utilization improves, but tail latency exceeds the decision deadline for rare long requests, causing retries and duplicate work.

Take a server that typically responds in 10ms but has a 99th-percentile latency of one second. Handled by that one server, a request is slow once in 100 — a rounding error on any dashboard. Wait on a hundred such servers in parallel and the picture inverts. Jeffrey Dean and Luiz André Barroso wrote it out in 2013: “If a user request must collect responses from 100 such servers in parallel, then 63% of user requests will take more than one second”. Make the servers a hundred times better — one slow response in 10,000 — and fan out to 2,000 of them, and almost one user request in five still takes more than a second. The tail is multiplied by fan-out. It is not averaged away by it.

The effect has been reproduced outside the paper. Three researchers at Cornell rebuilt it in a simulator validated against a real NGINX deployment, and concluded that “for cluster sizes greater than 100 servers, 1% of slow servers is sufficient to drive tail latency high, consistent with the results in [16]”. Reference 16 is Dean and Barroso.

Cost optimization should measure acceptable decisions delivered, not isolated kernel efficiency. Reliability, queue behavior, human workload, and rework belong in the denominator.

Example

Autoscaling arrives after the traffic spike

On 7 December 2021 the scaling action was the incident. AWS's own summary of the US-EAST-1 service event states the trigger plainly: “At 7:30 AM PST, an automated activity to scale capacity of one of the AWS services hosted in the main AWS network triggered an unexpected behavior from a large number of clients inside the internal network.”

  • Trigger: The automated capacity-scaling activity at 7:30 AM PST produced a connection surge from a large number of internal clients. It overwhelmed the networking devices between the internal network and the main AWS network.
  • Amplification: The resulting latency and errors caused, in the company's own words, “even more connection attempts and retries”. A large part of the load was manufactured by the response to the load.
  • Duration: Congestion improved only by 1:34 PM PST, and all network devices fully recovered at 2:22 PM PST — nearly seven hours after the trigger. EC2 launch APIs recovered at 2:40 PM PST, STS only at 4:28 PM PST.
  • User effect: Netflix traffic was down 26% that day, PBS NewsHour reported. Delta and Southwest, Instacart, Venmo, Kindle, Roku, Disney+ and the McDonald's app were among the services hit.
  • Repair: Forecast known events, prewarm capacity, scale on leading queue signals, and bound admission — so that retries cannot become the next spike.

Visual

The cost stack of an ML decision

Compute is visible, but several other costs determine the real system economics — and even the visible layer is not where most of the compute sits.

Serving, not training, is where the power goes. Meta published its own split in 2022: “At Meta, we observe a rough power capacity breakdown of 10:20:70 for AI infrastructures devoted to the three key phases — Experimentation, Training, and Inference”. Seven watts in ten go to serving. AWS's Well-Architected Framework puts the same weight on the invoice: “Up to 90% of the infrastructure spend for developing and running ML applications is often on inference.” Two operators with no reason to agree, one conclusion. The training run is the story. The serving tier is the bill.

The same Meta paper reports an approximate 30%/70% embodied-versus-operational carbon split for its large-scale ML tasks. Roughly a third of the footprint is already fixed in manufactured hardware before a single request arrives. A cost stack drawn only around model compute misses the layer that carries seventy percent of the power and, on the AWS figure, up to ninety percent of the spend.

FigureLayers · 5 layers
  1. 01

    Model compute

    Training, inference, accelerators, compilation, and memory movement.

  2. 02

    Data and retrieval

    Storage, feature access, indexing, transfer, and preprocessing.

  3. 03

    Reliability reserve

    Redundancy, headroom, rollback capacity, and disaster recovery.

  4. 04

    Human operations

    Review, annotation, incident response, support, and governance.

  5. 05

    Failure and rework

    Retries, false alerts, bad decisions, compensation, and retraining.

Capacity plans need the shape of demand

Average request rate hides peaks, burst length, request size, feature latency, model heterogeneity, and warmup time. Training plans also need queueing, checkpointing, failure waste, and experiment concurrency.

Use workload units such as examples, valid tokens, images, entities, or completed batches, because a raw request count may combine tiny and enormous jobs that consume very different resources.

The unit is not cosmetic, and the gap it hides is measurable. One table in the Dean and Barroso paper reports a real Google service twice. Measured at the root, the 99th-percentile latency for one random leaf to finish is 10ms. The 99th percentile for all leaf requests to finish is 140ms. Both rows describe the same user-visible operation. A capacity plan built on the first number is not the plan built on the second, and only the second is what the user waits for.

Analogy

Capacity is a reservoir with slow pumps

Traffic is water entering a reservoir, and serving capacity is the pump. Average inflow can be modest, yet a short storm overflows the basin before new pumps are installed. Queue limits and spillways resemble admission control and fallback.

Rain, at least, is indifferent to the reservoir. Traffic answers back: a request that times out is retried, so an overflow raises the very inflow that caused it. The drops also differ in size and in priority, since a long generation and a cached lookup count as one request each only on the dashboard. Workload classes and feedback effects therefore have to be modeled explicitly.

On 12 June 2025 an outage wrote that feedback clause down for the operator. Blank fields in a replicated quota policy hit an unhandled null pointer and put Service Control binaries into a crash loop. The incident ran three hours, from 10:49 to 13:49 US/Pacific, across all regions. Recovery in us-central1 then took up to about 2 hours 40 minutes, because the restarting tasks “created a herd effect” on the Spanner table they depend on. Google Cloud's report names what was missing: “Service Control did not have the appropriate randomized exponential backoff implemented to avoid this.” More pumps were not the fix. Google recovered by throttling task creation — by narrowing the inflow it controlled.

Capacity policy manages bursts, startup delay, and request diversity—not average demand alone.

Comparison

Efficiency metrics optimize different bottlenecks

A single “cost per request” number can reward the wrong design. Utilization, time-to-quality and cost per acceptable decision can all move in the right direction while the user waits longer. The 10ms row and the 140ms row of that Google table are one service, read with two different units. The three columns below are meant to be read together rather than ranked.

FigureComparison · 3 columns

System efficiency

Uses hardware well for a given workload.

  • Utilization and throughput
  • Memory and communication
  • Batching and compilation
  • Can ignore statistical quality

Statistical efficiency

Reaches target quality with fewer examples or updates.

  • Time to quality
  • Sample and optimizer efficiency
  • Experiment budget
  • Can use expensive hardware inefficiently

Operational efficiency

Delivers acceptable decisions with bounded reliability and human cost.

  • Cost per valid outcome
  • Queue and fallback burden
  • Incident and maintenance cost
  • Best measure for product tradeoffs

Steps

Build a capacity and cost plan

Use measured workload distributions and explicit service objectives. The two incidents in this lesson each show which step was missing. On 7 December 2021 retries fed the congestion they were a response to. On 12 June 2025 Service Control had no randomized exponential backoff to damp the herd effect its own restarts created, and Google Cloud's report says so outright. Neither gap is visible in an average-utilization chart.

FigureProcess · 5 steps
  1. 1. Define workload units

    Examples, tokens, images, entities, jobs, and request-size distributions.

  2. 2. Measure the full path

    Include data, retrieval, queueing, model, policy, retries, and human work.

  3. 3. Model peaks and recovery

    Account for bursts, startup, failover, backlogs, and rollback reserve.

  4. 4. Compare interventions

    Batch, cache, compile, compress, route, scale, or simplify the workflow.

  5. 5. Validate outcomes and slices

    Check service objectives, quality, fairness, and total cost per acceptable decision.

Key idea

Cost limits can create unequal service

Caching, truncation, smaller models, and degraded tiers may affect languages, devices, regions, or rare cases differently, and cutting cost across the board can move error or latency onto populations with lower volume.

The billing unit can do it before any tier is degraded. One 2023 paper measured what happens to the same text translated into different languages: tokenization lengths differ by up to 15 times, and by over 4 times even for character- and byte-level models. A second group, also in 2023, measured OpenAI's API across 22 typologically diverse languages. Some need 5 times as many tokens to convey the same information. On XLSUM, prompt-plus-generation cost ran up to 4x English for Telugu and Amharic — and model utility was lower for exactly those speakers. Their own worked example: “While LMs like ChatGPT might perform tasks in Telugu, for example, a user in Andhra Pradesh might pay 5× more than an English user in the US for an equivalent use of the model.” One price list, applied identically to everyone, is already an unequal price.

Evaluate cost changes by slice, request shape, and fallback path. Capacity policy is part of the product policy.

An efficiency improvement is incomplete until its quality and latency distribution are known.

Optimize the operating point, not the component benchmark

A smaller model may reduce compute but increase manual review. A faster cache may serve stale features. A lower redundancy level may save money while consuming the error budget during ordinary failures.

Every anchored case above has the same shape. The number that was optimized was not the number that governed the outcome. An automated scaling activity improved capacity and produced an event whose network devices did not fully recover for nearly seven hours. A carbon estimate built on assumed hardware came out 88X too high for the operator that ran the job. A per-token price identical for every customer charges a Telugu user 5× what it charges an English one. Ninety percent of the spend, on the AWS figure, sits in a serving tier that no training benchmark measures.

Present cost decisions with quality, reliability, human burden, slice impact, and recovery capacity on the same page.

Case

The large carbon number traveled and the small one did not

Two published carbon figures show how easily an estimate goes wrong. In 2019 Strubell and colleagues estimated 192 lbs of CO2e for training one Transformer (big) model, and 626,155 lbs for the same model found by neural architecture search. Their Table 1 set those against 126,000 lbs for “Car, avg incl. fuel, 1 lifetime” and 1,984 lbs for one passenger flying New York to San Francisco. The large number traveled and the small one did not.

It also traveled without a denominator. The fleet those runs sit inside has been measured. Lawrence Berkeley National Laboratory's 2024 report on US data centre energy found that “U.S. data center energy use has continued to grow at an increasing rate, reaching 176 TWh by 2023, representing 4.4% of total U.S. electricity consumption.” That is up from about 76 TWh, or 1.9%, in 2018. The same report projects roughly 325-580 TWh by 2028 — 6.7% to 12.0% of forecast US consumption, or 74-132 GW of power demand at 50% capacity utilization. The Electric Power Research Institute scoped the same growth independently in 2024: “Data centers grow to consume 4.6% to 9.1% of U.S. electricity generation annually by 2030 versus an estimated 4% today.”

A single training run set beside a car is a vivid sentence. A national fleet total is the quantity a capacity decision or an energy policy actually moves. The two are not interchangeable.

Figure

Four rows of Table 1 on a log axis, and the 88× a later measurement removed from the largest of them.

Case

The same search, measured, came out 88 times lower

Measure a neural architecture search on the hardware that ran it, instead of estimating it from assumed hardware, and the answer moves by two orders of magnitude. Patterson and eight co-authors did that measurement in 2021. They “reduce by 88X an earlier estimate of the CO2e for the neural architecture search for Evolved Transformer”, and report that the earlier energy estimate “ended up 18.7X too high for the average organization … and 88X off in emissions for energy-efficient organizations like Google”.

The breakdown is worth keeping. 5X came from assuming P100 GPUs and the US average energy mix rather than TPUv2 in a Google datacenter. 19X came from assuming the search used full-size models rather than the small proxy it actually used.

The building half of that 5X is still live, and still that large. Google states that “In 2025, the average annual power usage effectiveness for our global fleet of data centers was 1.09.” — 0.09 W of facility overhead for every IT watt. The Uptime Institute's 2025 global survey found a weighted average annual PUE of 1.54 across 681 respondents, or 0.54 W of overhead; Google's own comparison of 0.09 against 0.54 is 83% less overhead. Uptime's regional figures were 1.4 for China, 1.49 for North America, 1.50 for Europe, 1.65 for Latin America and 1.68 for the Middle East and Africa, and Uptime notes the global average has barely moved for six consecutive years. Lawrence Berkeley National Laboratory puts the US national average at 1.6 in 2014, falling to 1.4 in 2023, with infrastructure energy dropping from 40% of total data center electricity in 2014 to 30% in 2023.

The original concern was reasonable. The lesson is narrower and harder: a cost estimate built on an assumed processor, an assumed grid and an assumed building can be wrong by two orders of magnitude before anyone questions the model.

Key takeaways