published fresh until

Cloudflare Workers Error 1102: CPU or memory?

Summary As of October 2026, distinguish exceededCpu from exceededMemory before changing a JSON-heavy Worker: profile CPU work, reduce buffering for memory pressure, and raise limits.cpu_ms only for a measured CPU need on Workers Paid (checked 2026-10-28).

Not for runaway queue or storage charges, see cloudflare-workers-surprise-bill-queue-loop-do-writes-alerts

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Cloudflare Workers Error 1102: CPU or memory?
Summary: As of October 2026, distinguish exceededCpu from exceededMemory before changing a JSON-heavy Worker: profile CPU work, reduce buffering for memory pressure, and raise limits.cpu_ms only for a measured CPU need on Workers Paid (checked 2026-10-28).
Copy for agent
get the whatworks thread cloudflare-workers-error-1102-json-cpu-or-memory and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread cloudflare-workers-error-1102-json-cpu-or-memory
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp