6.6.8 Build Infrastructure Cost and Impact

A remote cache can save millions of action executions and still be a poor investment for one workload. Remote execution can reduce a wide build's critical path and still increase cost for small incremental builds. The useful question is therefore not “what is our hit rate?” or “how many CPU hours did we save?” It is: for a defined workload, which design produces the required correctness and reliability at the best combination of user wait, throughput, and total cost?

6.6.7 Planning Capacity for Build Infrastructure supplies the baseline, burst, scale-lag, and failure headroom that must be paid for. 6.6.3 Measuring Build-Service Latency and Reliability supplies comparable user journeys and service-stage measurements. This article turns those two views into an economic decision without pretending that every saved machine-minute becomes a saved developer-minute.

Count the whole service, not one invoice line

A build-service cost model needs the same boundaries as its lifecycle trace. For each invocation and action cohort, attribute the resources consumed by:

  • Action Cache metadata operations and storage;
  • CAS blob storage, replication, reads, writes, and retention;
  • network transfer, including cross-zone or cross-region traffic and output materialization;
  • scheduler, executor, and CI-runner compute;
  • repeated work caused by retries, failed attempts, and unusable cached results;
  • warm capacity, idle capacity, and failure headroom;
  • the control and evidence planes, including BES ingestion and telemetry.

This list prevents two common accounting errors. First, “cache cost” is not just stored bytes. Publishing and retaining a result can incur CAS writes, replication, storage, and Action Cache updates. Consuming a hit instead incurs an Action Cache lookup plus whatever CAS reads, downloads, materialization, and egress that consumer needs. Replication during a read belongs in the reuse cost only when the measured backend actually performs read repair or read-triggered replication; REAPI does not require it. Second, spare capacity is not free merely because no action ran on it. Warm runners and reserved executor headroom buy lower startup latency and resilience to bursts or failures; their idle time is part of the design's cost.

The model should preserve a consistent normalization contract. Useful units include cost per completed invocation, per required presubmit result, per eligible action, or per user journey. The unit, cohort, eligibility definition, and observation window must match. Designs may complete different counts within that shared contract: divide each design's attributed cost by its own completed count, and retain the count or completion rate as a separate throughput outcome. A common population and observation window are necessary, but they do not make unlike units interchangeable. Keep a resource vector, or convert every quantity through an explicit versioned rate: vCPU-s × $/vCPU-s, GiB-month × $/GiB-month, transferred GiB × $/GiB, requests times their request rate, and operator hours times their labor rate. Add fixed, idle, and failure-headroom cost through a declared allocation policy, such as measured usage share or reserved capacity share, then divide the monetary total by the chosen completed-result denominator. Keep latency, throughput, reliability, and correctness outside that sum.

Allocation is not realization. Avoided execution or freed capacity becomes a cash reduction only when marginal usage, purchased capacity, or a commitment can actually be reduced. Otherwise record it as available headroom or displaced work, not money saved.

An evaluation methodology for remote caching and execution illustrates the importance of these boundaries: it uses a production-representative workload, holds the hosting platform constant, runs configurations continuously, and isolates their cloud accounting rather than extrapolating from an unrelated sample repository.1 A shadow workload can be a useful comparison, but its omissions must remain visible. If it builds but does not test, for example, it does not measure test execution, result delivery, or their costs.

Separate useful reuse from headline hit rate

A hit-rate denominator answers a protocol question, not an investment question. Suppose two action cohorts each report 80% cache hits. In one, hits avoid ten-minute link actions and return small outputs. In the other, hits avoid short actions but download large artifacts over an expensive network path. The ratios match; the compute avoided, bytes transferred, user wait, and cost do not.

Measure reuse per cohort with at least these quantities:

QuantityWhat it reveals
Eligible lookupsThe population that could have reused a result
Usable hitsResults whose referenced content was available and accepted
Avoided executionWork not recomputed because of those usable hits
Reuse transferMetadata and bytes read to consume the result
Publication costExecution, upload, and storage needed to make the result reusable
Repeated workRetries, failed uploads, misses, and recomputation
Critical-path effectChange in the journey's actual wait, not the sum of all action durations

Remote caching is most valuable when one execution can be reused across many developers or CI jobs over the result's useful lifetime.2 Yet the value of that reuse depends on action cost, stability of the action key, artifact size, network path, and whether the action lies on the critical path. Do not add all avoided action CPU durations and label the total “developer time saved.” Parallel actions overlap, background CI consumes throughput without a developer waiting synchronously, and faster execution outside the critical path may not change the journey at all.

A practical cohort record can therefore look like this:

CohortUseful reuseRecompute avoidedTransfer and service costUser outcome
Interactive compile, small outputsusable hits per eligible lookupexecutor time and queue demand avoidedAC/CAS reads plus output bytesmedian and tail edit-build wait
CI integration test, large logsreusable test results per eligible testrunner or executor work avoidedresult, log, and artifact transferpresubmit throughput and time to result
Release link, low reusesuccessful reuse within its valid cohortexpensive link attempts avoidedpublication/retention separately from reads and downloadrelease completion and reliability

The entries are a schema, not invented benchmark data. Populate them from the same correlated action, result, blob, transfer, executor, and journey evidence used by operations. A cache miss is not automatically waste: a changed input may require recomputation. A hit is not automatically value: fetching and materializing it may cost more or take longer than executing locally, a tradeoff that 6.4.1 Choosing Execution Strategies must account for.3

Compare designs as complete systems

Do not evaluate “remote cache,” “warm CI,” “remote execution,” and “faster local machines” as isolated features. Each is a complete path with a different fixed cost, marginal cost, failure mode, and latency shape.

  • Cache-only retains local or CI execution while sharing reusable results. It pays for cache service and transfer, but can avoid scheduler and remote executor complexity.
  • Warm CI pays for persistent state and idle runner capacity to preserve Bazel's analysis and filesystem state. Its economics depend on assignment, health, revision locality, and demand variation.
  • Remote execution adds scheduling, CAS traffic, executor pools, and operational complexity. It is strongest when expensive, wide work can be matched to remote capacity; using it merely to cover poor determinism can increase both work and cost.4
  • Local investment buys developer-machine capacity or reduces the work Bazel requests through graph, rule, toolchain, and action improvements. It can outperform a remote path for small incremental journeys while doing little for wide CI workloads.

For each candidate, build a decision table with the same cohorts and observation window:

DimensionRequired comparison
WaitEnd-to-end journey distribution and critical-path stages
ThroughputCompleted eligible journeys or required results per interval
ReliabilityFailure, incomplete-result, retry, and degraded-mode behavior
CorrectnessHermeticity and result-integrity constraints that may not be traded away
CostFixed, variable, transfer, storage, retry, idle, headroom, and operating cost

Correctness is a gate, not a discount. A cheaper system that serves results from incompatible action keys or depends on undeclared machine state is not an economic optimization. Hermeticity makes reuse defensible; it does not by itself prove that reuse changes developer wait or pays for the service.

Test uncertainty instead of hiding it

Every decision model contains assumptions: arrival rate, reuse lifetime, artifact size, network price, action duration, burst shape, failure rate, scale-up lag, and the fraction of measured wait that an intervention can change. Record each assumption as a range, not a convenient point estimate.

Then vary one or two uncertain inputs across plausible bounds. If remote execution wins only when every cache miss is expensive, egress is negligible, and the fleet is continuously utilized, the recommendation is fragile. If cache-only remains preferable across low and high demand, different retention windows, and a measured failure interval, it is a stronger decision. The same analysis exposes break-even observations worth measuring next: output bytes by action class, reuse count before eviction, unmatched queue time, or idle runner hours.

Use a controlled, production-shaped experiment rather than comparing a warm incumbent with a cold candidate. Hold revision, target scope, configuration, platform, and workload schedule comparable; include warm-up explicitly; and separate interactive, presubmit, postsubmit, and release cohorts. Continuous shadow pipelines can reveal normal workload variation, while isolated cloud accounts or equivalent cost allocation make configuration costs distinguishable.1

Treat reliability events as part of the experiment. A design that is cheapest only when every component is healthy omits the cost of retries, cold recovery, fallback load, and reserved failure headroom. Conversely, capacity held for a tested degraded mode has a purpose; label it as resilience cost rather than calling it waste.

The economics decision contract makes this normalization inspectable with deterministic teaching data. Its fixture separates publication and replication from per-hit reads, converts each transfer path with a dated rate-set identity, varies demand, reuse, transfer, failure, and rates across explicit low/base/high scenarios, allocates fixed and headroom cost, and excludes a cheaper but incorrect design. The contract tests also reject a mismatched normalization unit, a missing sensitivity dimension or transfer-path rate, an absent allocation policy, and claimed cash savings without reduced capacity or commitment. Replace the teaching values with your measured quantities and rates; the fixture is a decision schema, not a benchmark or universal price model.

think

Decide: A remote-execution trial reports lower total executor CPU and a higher cache hit rate, but interactive P95 wait is unchanged and cross-region transfer cost rises. Has the trial demonstrated positive developer value?

Reveal

No. It has demonstrated changes in compute, reuse, and transfer cost. The unchanged interactive tail means the trial has not shown improvement for that user journey; the benefit may instead be CI throughput, another cohort, or capacity headroom. Compare those outcomes explicitly and run sensitivity analysis on transfer and failure costs before choosing the design.

Keep salary arithmetic in its proper place

Multiplying measured wait by an average loaded salary can illustrate why a problem deserves investigation. It is not evidence that every minute becomes productive engineering time, that the organization can realize the amount as cash, or that users would pay that amount for the intervention.

If you include such an illustration, label every assumption: how much wait is synchronous, how many people are affected, whether waits overlap with other work, which percentile and cohort the estimate represents, and what fraction the candidate can actually remove. Present a range and keep it separate from observed infrastructure spend, journey latency, throughput, reliability, and rework. Use this evidence as an input to the decision rights and budget process in H.8.1 Decision Rights. The build-service model makes that decision auditable; it does not approve the investment by itself.

key takeaway

Evaluate build infrastructure with one cohort-aware model that joins usable reuse, recomputation, transfer, execution, retries, storage, replication, warm capacity, idle time, and failure headroom to end-to-end wait, throughput, reliability, and correctness. Separate publication and retention from per-hit consumption. Normalize unlike resource quantities with explicit rates and a declared shared-cost allocation before using a consistent denominator. Cache hit rate, stored bytes, executor utilization, avoided CPU, and freed capacity are inputs; none is realized savings by itself.

Compare cache-only, warm CI, remote execution, and local investment as complete systems under representative and controlled workloads. Treat correctness as a gate, include degraded-mode costs, and vary uncertain assumptions until you know whether the recommendation is robust. Salary-times-minutes may illustrate a hypothesis, but measured journey outcomes and sensitivity ranges—not simplistic multiplication—support the investment decision.

Check your understanding · 4 questions

1.Match each measurement to its treatment in a comparable cost model:

Drag each answer onto the matching prompt, or click an answer and then click a prompt

Answers
Executor vCPU-seconds consumed by the cohort
Reserved failure-headroom cost shared by several cohorts
Interactive build latency distribution
Completed required presubmit results

2.A cache-only design costs $900 for 900 completed required results. A remote-execution design costs $1,000 for 1,250 completed required results. A third design costs $500 but returns results from incompatible action keys. What is the defensible comparison?

Select one answer

3.Classify these claims about reuse cost and claimed savings:

Choose True or False for each sentence

CAS publication writes, replication, retention, and Action Cache updates belong to the publication lifecycle rather than every hit.
Every cache hit should include replication cost because REAPI requires a backend to replicate blobs while serving reads.
Freed executor capacity is a cash saving even when purchased capacity and commitments remain unchanged.
Salary multiplied by measured wait can frame a hypothesis, but does not establish realized cash or productive time.

4.A recommendation changes when egress price or result reuse lifetime moves within its plausible range. Which actions make the decision more reviewable?

Select all that apply

0 of 4 answered

Footnotes

  1. How to Evaluate Remote Caching and Execution — production-representative load, controlled platform, continuous shadow pipelines, and isolated infrastructure accounting 1 2

  2. What to Remote Expect When You're Executing - George Gensure, Buildfarm — reuse across developers and time as the central remote-caching and execution value model

  3. Bazel dynamic execution (blog series) — cases where remote download cost can exceed local execution cost and strategy choice must include transfer

  4. Estimating the effort to build a Bazel CI/CD — warm runners, cache determinism, demand-matched capacity, and the warning against using RBE to mask poor cache reuse