Skip to content

docs(gotcha 36): the 10ms CPU limit is a clamp under load, not a flat wall - #398

Merged
oddharsh merged 1 commit into
mainfrom
docs/gotcha-36-cpu-correction
Aug 15, 2026
Merged

docs(gotcha 36): the 10ms CPU limit is a clamp under load, not a flat wall#398
oddharsh merged 1 commit into
mainfrom
docs/gotcha-36-cpu-correction

Conversation

@oddharsh

Copy link
Copy Markdown
Owner

Correcting a number I wrote into gotcha 36 in #395. The very next measurement contradicted it, and CLAUDE.md is the file other sessions read as truth.

What was wrong

The note stated Workers Free's 10ms per-invocation CPU limit as a hard ceiling a single request meets. Production says otherwise:

  • On the OLD code, /lens/fetch requests finished ok at 90ms and 196ms.
  • The 03:00Z window that showed 31 of 51 requests dying exceededCpu at exactly 10ms was a clamp under sustained load, while /lens was being hammered.

Same code, different answer depending on how busy the account is. That is why this presented as intermittent, and why chasing a repro on one URL kept exonerating the wrong things.

The subrequest cap stays the hard, deterministic one, and it is what definitively broke the covers at ~67 against 50. That half of the note is unchanged.

Also recorded: how to verify a fix like this

A pass/fail probe could not see it. All twelve A/B requests returned 200, on both versions. The difference was CPU:

version CPU (ms) median spread
OLD, sig2 on 23, 30, 39, 64, 68, 90 51 67
NEW, sig2 off 11, 13, 13, 17, 17, 21 15 10

And one trap worth the line: Cloudflare-Workers-Version-Overrides wants the FULL version UUID. The 8-char prefix silently fails to pin and lands every request on the majority version, which reads exactly like a fix that changed nothing. It cost one wasted A/B here.

Status of the fix itself

Confirmed live at the 10% canary: 21/21 covers and 21/21 artist photos, 42 art refs in the rendered fragment. The full job is still parked on the reviewer gate.

Docs only, no code change. 277/277 contract tests pass.

… wall

The note shipped yesterday stated Workers Free's 10ms per-invocation CPU
limit as a hard ceiling a single request meets. Measuring production the
same day contradicted it: requests finish `ok` at 90ms and 196ms when the
account is quiet, and the 03:00Z window that showed 31 of 51 dying at
exactly 10ms was a clamp under sustained /lens load. Same code, different
answer depending on how busy the account is, which is why this presented as
intermittent.

The subrequest cap stays the hard, deterministic one, and it is what
definitively broke the album covers at ~67 against 50.

Also records how the fix was actually verified, since a pass/fail probe
could not see it: all twelve A/B requests returned 200 on both versions,
and the difference was CPU, at a median of 51ms against 15ms. And the
version-override header wants the FULL UUID, because the 8-char prefix
silently fails to pin and lands every request on the majority version,
which reads exactly like a fix that changed nothing.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
aadhar-sh f27309b Aug 15 2026, 12:04 PM

@oddharsh
oddharsh merged commit 12c1b62 into main Aug 15, 2026
6 of 7 checks passed
@oddharsh
oddharsh deleted the docs/gotcha-36-cpu-correction branch August 15, 2026 12:11
oddharsh added a commit that referenced this pull request Aug 16, 2026
…verse (#416)

This gotcha claimed twice that the Copilot check fails on every diff, and one of
those claims went in a few hours ago as the general lesson. It is wrong. The run
always fires; whether it REQUESTS A MODEL depends on the diff.

The job prints a file exclusion list on every run, covering js, json, mjs, ts,
py, rs, yaml, yml, html, xml, go, java, c/cpp, rb and more. `.md`, `.sh` and
`.css` are NOT on it. So a docs diff survives the filter and gets a
`claude-opus-4.6` request, while a pure JavaScript diff is filtered to nothing
and the run exits clean.

Both paths print `Sessions disabled: not supported for code scanning yet`, which
this session initially read as the discriminator and is not; the discriminating
line is `Creating copilot-sdk session with model`, which only the failing path
reaches.

Correlates 12 of 12: the five runs of 2026-08-15 (#399 jpg/json and #402 js/mjs
passed; #398, #400 and #401 all carried md and failed), plus all seven earlier
failures checked backwards. #313 is the "CSS-only" diff this gotcha already
singles out, and css is not on the list either. #351's note here called its
entire diff a `${{ }}` move in workflow files; it touched md and mjs too, and
the md is what drew the request.

The prose-only argument is unchanged in conclusion and inverted in mechanism: a
docs PR reddens this because markdown is one of the few things the detector
still looks at, rather than because the agent choked on prose. The entitlement
root cause is untouched.

Records the method failure too, since it is the transferable part. Nine entries
were built by pattern-matching outcomes across PRs without once reading which
files each diff touched, and "fails on everything" was an artifact of that
sample. One uncollected column explained the whole shape.

Co-authored-by: Aadharsh Pannirselvam <19518661+oddharsh@users.noreply.github.com>
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.

1 participant