Repository navigation
Replies: 3 comments
|
Follow-up — correcting my own diagnosis above. I want to amend my conclusion before it misleads anyone. I attributed the failure to the Workers Free plan's 10 ms per-request CPU limit, on the strength of the failing invocation reporting cpuTime: 10. I now think that was coincidence, and my own evidence contradicts it. In the same 45-request sample: 39 warm invocations reported 11–31 ms CPU and returned ok outcome: exceededCpu What makes this plausible here is bundle size. From wrangler deploy --dry-run on my tree (13 commits ahead of upstream, but no dependency changes — package-lock.json untouched): Total Upload: 8354.79 KiB / gzip: 2142.74 KiB The failure rate I measured was roughly 5% of requests across ~140 samples, and it is route-independent — including /, whose loader is a cookie read and a redirect. A route that does no work cannot exceed a per-request budget, but it can be the request that pays for a cold start. scripts/check-bundle-size.mjs guards the 3 MiB compressed script size limit, and the bundle passes it comfortably at ~70%. Nothing measures startup cost, which looks like the actual binding constraint. Four questions, and I'm happy to be told I've misread this: Has 1102 been reported against a stock one-click deploy before? (All of this above was written by Claude. I'm posting this as informational, only, with good intentions) |
|
Resolved — root cause found, and it's one import.
It cannot be anywhere else, either.
This is also the invariant
The fixBoth readers ( The class export stays static, so wrangler is unaffected; only the payload defers. It matches Effect on the bundleMapping static vs. dynamic reachability from the entry chunk:
| before | after
-- | -- | --
Eager graph (evaluated every cold start) | 1,291 KiB | 791 KiB
— entry chunk | 1,258 KiB | 757 KiB
Total upload | 8,355 KiB | 8,355 KiB
The 120–190 ms cold starts are simply absent now. Nothing above 20 ms. One suggestion
Happy to open a PR with the change and the gate if that's useful — it's a three-line diff plus a comment explaining why the import can't go back. |
|
Thank you — this was a much better investigation than ours, and your self-correction in the second comment is exactly what we would have got wrong. The fix is now on What we changed. One correction. We couldn't reproduce the CPU improvement: We also tested two other eager-import reductions. They significantly improved cold startup (273 → 59 ms) but had essentially no effect on warm production traffic (10.48 → 10.86 ms/tick, ~290 invocations each side). So the important distinction seems to be cold-start cost vs. warm production CPU. That doesn't contradict your finding. A ~900 KB eager payload is still worth removing, and your 1102 case is exactly where cold-start cost matters. If you're still seeing the 120–190 ms reduction, we'd be very interested — your tree is 13 commits ahead, so there may be a build difference worth finding. On the gate: we now report On 1102/docs: we also corrected the README and related documentation. We had actually hit 1102 twice on our own hosted deployment, but for a different CPU-limit reason. A 24-hour sample since then shows 1 One important goal of OpenInspection is to build a product that can be deployed for free on Cloudflare and operate within the Cloudflare Free plan limits. Worker CPU execution time is currently one of the main constraints we're working through, and we've already made several changes in that area. If you find other scenarios where we exceed the Free-plan limits, please let us know. PRs are very welcome as well. And sorry I didn't catch the discussion earlier — I should have been paying closer attention. Thanks for taking the time. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Measured it.
wrangler tailcaught a failing invocation, and it settles both questions.Across 45 requests: 43 ok, 1 exceededCpu (one request never reached the Worker). The CPU distribution:
Two corrections to what I told you earlier, both of which change the decision: the startup budget is 1 second, not the 400 ms I said, and it's not what you're hitting. And I said upgrading to Paid might not help — that was wrong. It's the per-request CPU limit, which your doc link puts at 10 ms on Free and 30 s on Paid. That's a 3,000× difference, and it's the whole problem.
Your app uses 5–31 ms of CPU on a warm login page and 120–190 ms on a cold one. It is over the Free budget on essentially every request. Cloudflare tolerates the burst most of the time and kills roughly one in ten to twenty.
Did we cause it?
No. The evidence:
package-lock.jsonuntouched;package.jsongained only anallowScriptsinstall allowlist./and/login— routes the phone work never touched./is a 12-line redirect.A 4 KiB delta cannot turn a 10 ms budget into a 190 ms cold start. The 8.2 MB bundle is upstream's architecture: React Router SSR, the full Hono API, Drizzle, the docx/xlsx export path, the MCP server, workflows and browser rendering all in one Worker.
Does origin address it?
No, and it's worse than silent. I searched the upstream repo — no issue mentions 1102, CPU limits, or Free-plan viability. Meanwhile the README says:
And the only guard in the repo,
----------------------------------------------------------------- You posted my message verbatim, which means the caveat I attached didn't go with it. I told you:scripts/check-bundle-size.mjs, watches the script size limit — "Workers Free: 3 MiB gzipped" — which you pass comfortably at 70%. Nothing in the repo watches CPU time. Upstream is measuring the one Free-plan limit this app doesn't hit, while blowing the one it does. That's worth an upstream issue once you're unblocked; it's a real finding about their deploy claim.I inferred Free plan from that 10 ms figure matching the documented limit exactly, not from your billing page. Confirm it on the Cloudflare dashboard before paying.
The post states Free plan as established fact. And there's a soft spot a sharp maintainer will find: the table shows 39 invocations at 11–191 ms returning ok. If the limit were a hard 10 ms per request, those should have failed too. My reading is that Cloudflare's Free enforcement isn't a strict per-request kill — it tolerates bursts, and startup CPU is reported in cpuTime without being charged the same way. That reasoning isn't in the post, so the strongest objection to it is sitting right there in its own evidence table.
The core finding holds regardless — outcome: exceededCpu with the exception "Worker exceeded CPU time limit" is not ambiguous, and it isn't caused by your commits. But if your dashboard says Paid, the post's central claim is wrong and you'd want to correct it yourself rather than be corrected.
That dashboard check is now doing double duty: it decides your $5 fix and whether your public post needs an edit. It's the one thing I can't do for you.
Also worth flagging since it's public: the post keeps the framing I wrote for you — "Did we cause it?", "your 13 commits", "worth an upstream issue once you're unblocked." Addressed to you it reads fine; addressed to the maintainer it reads like you're talking about them in the third person. Harmless, but you may want a follow-up comment that reframes it as a question to them.
All reactions