What this thread does
Worker exceeded resource limits A JSON-heavy Cloudflare Worker returns Error 1102 instead of its normal response. First action: open Metrics > Errors > Invocation Statuses and distinguish Exceeded CPU Time Limits from Exceeded Memory. Official limits identify both outcomes; community reports support workload sensitivity but do not establish the cause of your endpoint without logs and profiling (checked 2026-10-28). Not for: Cloudflare Workers queue loops or surprise storage charges; see the billing thread.
How to fix it
1. Correlate the failed request with its invocation outcome. The limits reference distinguishes exceededCpu and exceededMemory. Capture payload size and concurrency as diagnostic context, without logging private bodies. 2. For CPU exhaustion, profile the parsing, validation and serialization path using DevTools. Cloudflare's Error 1102 guidance recommends reducing loop work, optimizing JSON parsing, caching computed results and splitting large operations. Apply one change and compare the same input; a slow upstream request alone does not establish CPU exhaustion. 3. For memory pressure, use streaming where possible and avoid buffering large objects; no body-size or pagination fix is established for this endpoint. Inspect full-body reads, large temporary objects, response cloning and global collections. Cloudflare recommends streaming bodies through TransformStream or node:stream where the operation permits it. Ordinary whole-document JSON parsing still materializes the document; wrapping that parse in a stream does not make it incremental. 4. If profiling proves legitimate CPU work exceeds the configured budget, Workers Paid permits this exact Wrangler configuration from the limits page (checked 2026-10-28):
{"limits":{"cpu_ms":300000}}
This is the documented maximum, not a recommended default. Select a measured budget in your configuration. Increasing CPU does not increase memory, and this setting is not a Free-plan escape hatch. 5. Test the changed endpoint with small and large valid inputs, rejected oversized inputs, malformed JSON, and simultaneous requests. Confirm both the response and invocation outcome.
Diagnostic: Worker exceeded resource limits
The Workers errors table describes 1102 as CPU exhaustion, while the more detailed limits and support pages also document memory exhaustion. Use the invocation outcome to resolve that ambiguity. A 1101 JavaScript exception needs its exception stack instead.
Current limits
The limits page lists HTTP CPU allowance as 10 ms on Free and a 30-second default on Paid, adjustable to 300,000 ms; memory is 128 MB per isolate, shared across concurrent requests (all checked 2026-10-28). It also documents occasional CPU-overrun flexibility. One successful over-budget request does not establish a sustainable budget.
Evidence
- Willardgmoore's OpenSEO issue #377 reports intermittent 1102 responses and payload-sensitive failures. It also contains a separate subrequest-limit diagnosis. That second limit is not proof that JSON parsing caused 1102.
- grimbouk's workerd discussion #7681 reports successful minimal Python responses with variable CPU accounting and no CPU-exceeded outcome in the sample. It illustrates why raw timing and a failing invocation outcome must be distinguished; it does not validate a JavaScript JSON fix.
Pitfalls
Do not raise an HTTP timeout to repair CPU or heap exhaustion. Do not buffer a huge body before checking its size. Streaming is useful for forwarding or incremental transforms, but a filter that needs the complete object must still account for its working memory.
Prompt for your agent
Read the linked current Cloudflare limits and Error 1102 pages; your training may predate their settings. Inspect the failing route and redacted invocation outcome. Separate CPU work, whole-body buffering and upstream waiting. Propose one minimal change with an input-size and concurrency test. Do not deploy or change the plan. Label unmeasured fixes Untested experiment and do not assume CPU configuration raises memory.
Limits
No endpoint, load test or memory profile was run. The two community reports concern different applications and runtimes; they establish symptoms, not a universal JSON fix. Streaming feasibility depends on the operation, and local profiling alone does not prove deployed resource use.
Started from a post by @Cloudflare documentation, packaged by the editor. Original post