Skip to content

docs(cost): the CI speedup costs ~$30 a day, and nothing was measuring it - #499

Merged
athvin merged 1 commit into
mainfrom
bm/cost-probe-sccache-egress
Nov 5, 2026
Merged

athvin merged 1 commit into
mainfrom
bm/cost-probe-sccache-egress

Conversation

@athvin

@athvin athvin commented Nov 5, 2026

Copy link
Copy Markdown
Owner

The headline

October (full month) November (5 days)
total $184.23 $160.47

November is on pace for roughly six times October, and $76.27 of it is
one line nobody was watching:

usage type bucket USD units
USE2-DataTransfer-Out-Bytes er-ci-sccache 75.37 837 GB
USE2-Requests-Tier2 er-ci-sccache 0.68 1,709,346

837 GB at $0.090/GB. That is internet egress: GitHub-hosted runners are not
in the VPC, so an S3 Gateway Endpoint cannot help and every sccache read leaves
the region at the public rate.

Nov 4 isolates the cause, for free

That is the day the Actions billing block stopped CI from running at all:

day total USD sccache USD
2026-11-01 19.39 0.03
2026-11-02 32.48 12.46
2026-11-03 51.83 31.07
2026-11-04 21.55 0.00
2026-11-05 35.21 32.67

A day with no CI costs ~$20 and egresses nothing. A day with CI costs $32–52 and
the entire difference is this one line. Nov 1 reads as $0.03 only because AWS's
first 100 GB/month is free — consumed during Nov 2, which is why the charge
appears to start then rather than scaling from the first run.

This is the price of the CI speedup

#424 removed rust-cache, making sccache the only cache; the test job was then
sharded, multiplying the runners each pulling from it; and the hit rate is ~99%,
so nearly every compilation unit downloads its object. PR wall time went 32–35
min → ~10 min.

At ~$31 on each day CI runs that is roughly $600–900/month against a $600
budget that breaches mid-month
. The trade may well be worth it — the defect
is that nobody knew the number.

The baseline rose independently too: EC2 from ~$1.50/day in October to
~$7.60/day. That is the observability stack, the second web-api Deployment from
#461, and the dispatcher — all real, all new, none of it sccache.

Also: split cost allocation is still off

0 non-null out of 19,770 November rows for split_line_item_split_cost,
split_line_item_split_usage_ratio and split_line_item_parent_resource_id —
three days after the first probe said the same. It does not backfill, so three
more days of pod-level cost are permanently unrecoverable.

Recorded as a decision, not a fix

Four options, cheapest-to-change first: accept and raise the budget; move
sccache to the GitHub Actions cache backend (free egress, but ~10 GB per repo
with LRU eviction, so measure the hit-rate loss); self-hosted runners inside
the VPC
(in-region S3 is free and Actions minutes stop being metered — the
cluster and runner NodePools already exist); or narrow what sccache stores.

The one thing the doc rules out is emptying the bucket: a cold sccache costs a
42-minute PR, which is the problem it was built to fix.

Docs only — no behaviour change in this PR.

🤖 Generated with Claude Code

…g it

Re-ran the three CUR probes against the November partition. One probe is
unchanged and the spend underneath it is not.

Split cost allocation is still producing nothing: 0 non-null out of 19,770
November rows, three days after the first probe said the same. Three more
days of pod-level cost are permanently unrecoverable.

The thing the re-run was not looking for is that November is on pace for
roughly six times October. $160.47 in five days against $184.23 for all of
October. S3 was not in October's top five; in November it is $76.27, and all
of it is one line: 837 GB of `USE2-DataTransfer-Out-Bytes` from
`er-ci-sccache` at $0.090/GB. That is internet egress — GitHub-hosted runners
are not in the VPC, so a Gateway Endpoint cannot help and every sccache read
leaves the region at the public rate.

Nov 4 isolates the cause for free: that is the day the Actions billing block
stopped CI running, and it egressed $0.00 against a $21.55 total. A day with
no CI costs ~$20 and ships nothing; a day with CI costs $32-52 and the whole
difference is this line. Nov 1 reads as $0.03 only because the first 100 GB a
month is free, which was consumed during Nov 2.

This is the price of the CI speedup and it was never measured. #424 removed
rust-cache, which made sccache the only cache; the test job was then sharded,
which multiplied the runners each pulling from it; and the hit rate is ~99%,
so nearly every compilation unit downloads its object. PR wall time went
32-35 min to ~10 min. At ~$31 per CI day that is ~$600-900/month against a
$600 budget that breaches mid-month.

The baseline rose independently too — EC2 from ~$1.50/day to ~$7.60/day —
which is the observability stack, the second web-api Deployment from #461 and
the dispatcher. Real, new, and not sccache.

Recorded as a decision with four options rather than a fix, because trading
25 minutes of wall clock for this is a judgement call and the defect was not
knowing the number. The one thing the doc rules out is emptying the bucket: a
cold sccache costs a 42-minute PR, which is what it was built to fix.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin merged commit 192ff2f into main Nov 5, 2026
39 checks passed
@athvin
athvin deleted the bm/cost-probe-sccache-egress branch November 5, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants