# Cloudflare Workers error 1102 and the 10 ms CPU limit

ZapiszPrzepis kept returning 503 while I blamed Smart Placement, cold starts and my scanner. The cause was the Free plan CPU limit. Static files helped.

**Canonical:** https://spoko.space/blog/cloudflare-workers-cpu-limit-zapiszprzepis/  
**Language:** en  
**Published:** 2026-12-01  
**Tags:** Cloudflare Workers, Next.js, React, OpenNext, ZapiszPrzepis  
**Category:** Engineering

---
**For two weeks I named the wrong cause of the 503 errors on [ZapiszPrzepis](https://spoko.space/zapiszprzepis/) three times, while the answer sat in the body of those errors: `error code: 1102`.** That is how Cloudflare Workers reports a resource limit, in this case CPU time. On the Free plan the limit is 10 ms per request.

This post covers the mistakes, the measurements and what finally worked: public pages stopped going through the Worker. The cost of the render moved to the build and to the database instead.

## How the site runs {#how-the-site-runs}

ZapiszPrzepis is a Next.js 16 (App Router) and React 19 app running through OpenNext on Cloudflare Workers, on the free plan, with its data in Supabase. It had 925 public recipes at the time, and they rarely changed, but the session is read in the layout, so every public page is rendered on every request.

The limit is about CPU time. Waiting on the database does not count, so the dozen or so Supabase queries behind a recipe page only cost what the CPU spends handling them. Cloudflare's docs say server-side rendering and authentication typically use 10–20 ms. Static files skip the Worker, and they answered 200 throughout.

## Three wrong diagnoses {#three-wrong-diagnoses}

I wrote the PRs and comments this story comes from together with an AI agent. The decisions were mine, so the mistakes are too.

### 22 October: Smart Placement {#22-october-smart-placement}

I wanted moving between recipes to feel faster. The Worker runs near the reader and far from the database, so I [turned on Smart Placement](https://github.com/spokospace/zapiszprzepis/pull/465), one line in `wrangler.jsonc`. The Worker moved from Warsaw to Paris. For guests, [TTFB got 30–40 ms worse](https://github.com/spokospace/zapiszprzepis/issues/464).

Soon after, 35–50% of the requests served by the Worker were ending in a 503. Supabase and static files were fine, so I [reverted the change](https://github.com/spokospace/zapiszprzepis/pull/466). After the deploy 66 of 66 requests came back 200, and I wrote that this was strong evidence. A quarter of an hour later I wrote a correction: the 503s were back, on 10–30% of requests, and the 66 of 66 had only been a lull. The response body said `error code: 1102`.

Cloudflare data I read two weeks later shows 2,460 of those errors on 20 October, two days before Smart Placement went on.

`pnpm smoke:prod` missed the outage because it loaded each page once, and the TTFB runs did not record status codes. The smoke test [got 10 attempts per page](https://github.com/spokospace/zapiszprzepis/pull/467) and went red from then on.

Smart Placement itself [came back two days later in a separate PR](https://github.com/spokospace/zapiszprzepis/pull/519), from the task list in the same issue. Responses then carried `cf-placement: local-WAW`, so the Worker stayed in Warsaw. The planned re-check never ran, and the key stayed in the config.

### 29 October: cold starts {#29-october-cold-starts}

I knew the code by now, but not where it came from. The hint was `robots.txt`, which [in the logs of 22 October](https://github.com/spokospace/zapiszprzepis/pull/470) had a median of 257 ms CPU, because a nearly empty response loaded the whole Next.js bundle. I moved it to static files.

A week later the smoke test was still red and I [decided](https://github.com/spokospace/zapiszprzepis/pull/640) it was cold isolates after a deploy: a new version starts cold, the first render goes over the limit, and the problem clears. The test began retrying 1102 after 700, 1500 and 3000 ms, and an error that went away on retry became a warning. It went green.

No CPU measurement backed that diagnosis, and it turned down the alarm that was showing the outage. From 27 to 30 October Cloudflare logged between 1,543 and 2,725 errors 1102 a day.

### 30 October: a scanner that was too fast {#30-october-a-scanner-that-was-too-fast}

I was writing a piece about sitemaps and ran zapiszprzepis.pl through [UPER SEO Auditor](https://spoko.space/uper-seo-auditor/), my Chrome extension. Of 929 URLs, 551 returned 503 and 28 timed out. The scanner sent 5 parallel requests every 200 ms, even after the server had started refusing, so I decided it was overloading the site. It got a back-off, and failed URLs stopped counting as pages with no title.

The scanner needed those changes, but the cause was elsewhere. In the scan of 5 November, with the new pace, 373 of 586 URLs (64%) got no valid response, against 579 of 929 (62%) before.

**URLs answering 200 in each hundred of the sitemap**

| URLs | Scan | 200 responses |
| --- | --- | --- |
| 1–100 | 30 October, fixed pace | 100% |
| 1–100 | 5 November, with back-off | 100% |
| 101–200 | 30 October, fixed pace | 99% |
| 101–200 | 5 November, with back-off | 84% |
| 201–300 | 30 October, fixed pace | 91% |
| 201–300 | 5 November, with back-off | 3% |
| 301–400 | 30 October, fixed pace | 35% |
| 301–400 | 5 November, with back-off | 4% |
| 401–500 | 30 October, fixed pace | 7% |
| 401–500 | 5 November, with back-off | 10% |
| 501–600 | 30 October, fixed pace | 2% |
| 501–600 | 5 November, with back-off | 14% |
| 601–700 | 30 October, fixed pace | 7% |
| 701–800 | 30 October, fixed pace | 8% |
| 801–900 | 30 October, fixed pace | 1% |
| 901–929 | 30 October, fixed pace | 0% |

The 5 November export stops at 586 URLs. CSV rows follow scan order but carry no timestamps.

Of the 586 URLs in both exports, 145 worked on 30 October and failed on 5 November, and 25 went the other way. So the error does not stick to particular pages.

While writing this post I noticed one more thing: both scans ran as a signed-in user. In both exports the H1 of the home page is a greeting by first name, which the app shows only after sign-in, and the extension fetches pages with the browser's cookies. Those requests skip the guest cache described below, so these numbers describe a signed-in reader and not Googlebot.

## What the measurements showed {#what-the-measurements-showed}

I made the first fuller measurement only on [4 November](https://github.com/spokospace/zapiszprzepis/pull/701), from the Cloudflare dashboard, because the project token had no access to `wrangler tail`. Over 24 hours there were 8.63k invocations and 534 errors, 533 of them "Exceeded CPU Time Limits". That is about 6%.

Median CPU came out at 12.89 ms, 14.9 ms in another reading and 16 ms in a window on 5 November. The fair summary is "about 13–15 ms". The gaps between those numbers come from different windows and are not a trend. In a PR description I also wrote that most requests end in 1102. [I corrected that](https://github.com/spokospace/zapiszprzepis/pull/704): the 63% came from a 30-minute window dominated by my own probes.

[The wider picture](https://github.com/spokospace/zapiszprzepis/blob/master/.ai/runs/2026-11-05-worker-usage-and-static-build.md) came from 31 days of data: 195,632 requests and 15,514 errors, or 7.9%, my probes included. Median CPU of successful requests was 2.5–8 ms until 17 October and 10–57 ms after. An import of 622 recipes landed on 16 October, and new screens around the same time. I did not measure which of them raised the CPU.

The split by route over 24 hours on 5 November, counted on the 1,000 most frequent URLs, which is 70% of the CPU:

| Route | Requests | Mean CPU |
|---|---:|---:|
| `/przepis/*`, HTML | 2,014 | 86 ms |
| `/przepis/*`, RSC | 801 | 86 ms |
| `/`, HTML | 225 | 177 ms |
| `/przepisy/*`, HTML | 95 | 234 ms |
| `/login`, HTML and RSC | 169 | 57 ms |
| `/_next/image` | 152 | 6 ms |

A mean of 86 ms next to a median in the teens means a long tail: p90 was 169 ms, and p99 in recent days 600–770 ms. The docs explain how that is possible under a 10 ms limit: an isolate has flexibility for occasional overruns and terminates execution when a Worker hits the limit consistently. That would fit the many runs where the first 100 or so requests passed and errors began later. I did not test this idea, and it does not always hold: on the morning of 5 November errors began within the first 50 requests.

### Probes that disturbed the result {#probes-that-disturbed-the-result}

I wanted to know whether a route with no cookies and no session, `/lab/przepis/{slug}`, was cheaper. I sent 150 requests per pass, about 3 a second, straight at production.

| Round | Pass | 200 | 503 | Timeout |
|---|---|---:|---:|---:|
| [First](https://github.com/spokospace/zapiszprzepis/pull/701) | `/lab`, first visits | 136 | 14 | 0 |
| | `/lab`, same URLs | 103 | 47 | 0 |
| | `/przepis` | 39 | 76 | 35 |
| [Second, reversed order](https://github.com/spokospace/zapiszprzepis/pull/703) | `/przepis` | 107 | 43 | 0 |
| | `/lab`, first visits | 4 | 146 | 0 |
| | `/lab`, same URLs | 3 | 116 | 31 |

After the first round I wrote that the route without a session fails less often: 9% against 51%. The second round overturned that, because whichever pass ran later did worse. My explanation of the second pass turned out to be unproven as well. At 21:51 UTC all 15 dynamic pages I checked answered 503 while static files answered 200. A quarter of an hour later 6 of 9 were back. I probably contributed to that myself.

The next night [pre-rendered `/lab` pages](https://github.com/spokospace/zapiszprzepis/pull/706) gave 300 of 300 cache hits. In the morning [the same probe on other recipes](https://github.com/spokospace/zapiszprzepis/pull/707) gave 205 responses of 200 and 95 errors, which is 32%. I do not know why. Time of day and cold R2 reads are candidates I did not test. [I removed the experiment](https://github.com/spokospace/zapiszprzepis/pull/712).

## Next.js prefetch {#nextjs-prefetch}

The dashboard showed one thing I did not expect: 4,480 of about 8.6k invocations, around 52%, carried the `next-router-prefetch: 1` header. Most were `/?_rsc`, `/szukaj?_rsc` and categories, the links that are always visible in the header. Those routes have no `loading.tsx`, so the prefetch stored nothing useful and still started the Worker.

I switched it off there with `prefetch={false}`, [first in the header and categories](https://github.com/spokospace/zapiszprzepis/pull/701), [then in the footer and other links](https://github.com/spokospace/zapiszprzepis/pull/711). Recipe cards and Previous/Next kept their prefetch, because those routes have a `loading.tsx`. I did not measure the CPU saving. In the same PR guests stopped going through session handling, and I did not measure that separately either.

## A promise that belonged to another request {#a-promise-that-belonged-to-another-request}

Separately from 1102, the logs had requests that hung. [Over 7 days](https://github.com/spokospace/zapiszprzepis/pull/709) 344 took over 15 seconds, the longest 347 seconds, and ended as `canceled`. The app could sit on its splash screen for minutes.

On Workers, I/O objects belong to the request that created them, and Cloudflare warns against keeping such state at module level. The code had two places like that. One was the shared JWKS key fetch, added on 29 October, which the middleware awaited on every request, guests included:

```ts
// Module scope: shared by every request in the isolate
let inflight: { url: string; promise: Promise } | undefined

if (inflight?.url !== supabaseUrl) {
  const promise = fetchKeys(supabaseUrl).then(/* store the keys */)
  inflight = { url: supabaseUrl, promise }
}
return { keys: await inflight.promise }
```

If the request that started the fetch ends early, for example with a 1102, the promise never settles, and every later request in that isolate waits on it until the isolate is replaced. Now only a finished result stays in memory, and on an expired cache each request fetches the keys itself. The second place was the Supabase client for guests, whose `initializePromise` started in the singleton's constructor.

This is the most likely cause, not a proven one: I have not traced any hung request to these promises. The fix reached production on 5 November. In the nine hours after the static files described below went live, P999 wall time was 2 s, and the dashboard showed 74 `Cancelled` disconnects. I did not count requests over 15 seconds, so I cannot confirm this effect. Over the seven days up to 1 December P999 wall time was 3 s, and the dashboard showed 654 disconnects, but it does not split them by duration.

## What the edge cache gave {#what-the-edge-cache-gave}

Guests now get an [HTML cache](https://github.com/spokospace/zapiszprzepis/pull/704) in front of the OpenNext handler, in `custom-worker.ts`, built on the Cache API. It covers `/`, `/przepis/{slug}` and `/przepisy/{kategoria}`, with no session cookie and no router headers. A page is fresh for 120 seconds, and for up to 15 minutes it is served as `STALE` with a refresh in the background. The key includes the Worker version, so a page cannot outlive the `/_next/static` files it links to.

I did not know whether a cache hit would stay under the limit, since the code runs in the same bundle. A test path on a preview that skipped the handler passed 150 of 150 requests, while recipe pages at the same moment passed 134 of 150. After the deploy, 100 random recipes, twice in a row:

| Pass | 200 | 503 | `x-edge-cache` | Mean time of 200s |
|---|---:|---:|---|---:|
| First | 95 | 5 | 95 MISS | 0.66 s |
| Second | 100 | 0 | 94 HIT, 6 MISS | 0.13 s (HIT 0.09 s) |

No HIT failed, but that is one run and guests only. A miss still renders in the Worker and can end in 1102. The cache does not cover RSC navigation or signed-in readers, it works separately in each data centre, and a deleted recipe can stay visible to guests for up to 15 minutes. Every deploy starts with an empty cache.

I deployed the 5 November version at about 14:10 UTC. Between 14:00 and 15:00, 185 of 699 requests ended in an error, and the dashboard showed 29.2% at about 15:00. I do not know where that traffic came from. Part of it may have been my own scan, since I saved the export at about 14:15 UTC. `pnpm smoke:prod` passed, because it retried errors and never opened a recipe. [It now opens 30 random ones with no retry](https://github.com/spokospace/zapiszprzepis/pull/714) and accepts at most one failure.

## Three ways out {#three-ways-out}

**Optimisation.** With a mean of 86 ms per recipe, getting a render under 10 ms is not realistic. Cheap fixes still [went in on 5 November](https://github.com/spokospace/zapiszprzepis/pull/714): similar recipes go through the cache, an import purges only the recipes it changed, and data lives for an hour instead of 120 seconds. At 16:37 UTC, half an hour after the deploy, the dashboard showed 20.7% errors and a median CPU of 56.19 ms for this version. Over the last 24 hours, my probes included, that was 13.84k invocations and 2.25k errors, or about 16%.

The next version [took part of the layout work off the Worker](https://github.com/spokospace/zapiszprzepis/pull/715): the browser now reads the session, menu counters and notifications. At about 18:35 UTC the dashboard showed 3.2% errors and a median of 25.58 ms for it. Both readings come from the same day, at around 0.1 requests a second, so I do not treat them as proof. Both medians are also above the limit.

**Static pages.** This is the only option on the Free plan that takes the Worker off public page views. Every variant has the same precondition: a public page stops depending on who is reading it, and favorites and the session move to the browser. [The plan](https://github.com/spokospace/zapiszprzepis/blob/master/.ai/specs/2026-11-05-static-first-public-site.md) tried files from Next.js first, with [Astro](https://spoko.space/glossary/astro/) as the fallback, because Next.js improved the existing version and kept one renderer. [The comparison](https://github.com/spokospace/zapiszprzepis/blob/master/context/foundation/static-architecture-research-2026-11.md) looked like this:

| | Next.js files | Astro files | Workers Cache |
|---|---|---|---|
| Worker on a page view | No | No | Only on a miss, an 86 ms render |
| Paid plan | No | No | In practice, yes |
| JavaScript | 195 KB | 87–109 KB | 195 KB |
| Renderers | One | Two, unless page bodies are shared | One |
| Removing a page | A build or a redirect rule | A build or a redirect rule | At once, purge by tag |
| Evidence before choosing | One outside project | A pilot on 925 pages | None |

Workers Cache is not the cache in `custom-worker.ts` described above: a hit does not start the Worker at all. A miss still renders, so on the Free plan error 1102 would stay.

Zone Cache Rules were out too, because the request reaches the Worker before the cache, and so was PPR, because on OpenNext the shell still comes from the Worker. vinext is in beta and reads files through the Worker. A second build with `output: 'export'` meant full reloads between the parts of the site, and React Router, TanStack Start or all of the app on Astro meant rewriting 33 pages.

The Astro pilot built 925 pages locally in 3 min 16 s, at about 16 KB of gzipped HTML each. [In the lab](https://github.com/spokospace/zapiszprzepis/blob/exp/astro-pilot/.ai/runs/2026-11-05-mobile-cwv-baseline.md), on a slow phone profile, TBT was 60–138 ms against 810–1383 ms on production. The pilot leaves out the Previous/Next list bar, dish versions and the signed-in overlay, so that is an upper bound on the gain. On a Pixel 11 Pro over Wi-Fi the two versions came out about equal.

**The paid plan.** Workers Paid costs 5 USD a month and includes 30 million CPU ms, and the site used 10.2 million ms in 31 days. The CPU limit would stop being a problem, but the render would stay as slow as it is. At this stage I stayed on Free, with Paid as the fallback for screens that stay on the Worker, such as `/login` and `/dodaj`.

## What worked {#what-worked}

I did not make the render faster. I took it off the path of someone reading a recipe.

First the recipe page [stopped depending on who is reading it](https://github.com/spokospace/zapiszprzepis/pull/719): the gallery, step photos and owner buttons load in the browser. `generateStaticParams` was out, because in a local build a recipe outside the list and a missing URL both answered 500. So [the build starts the freshly built server](https://github.com/spokospace/zapiszprzepis/pull/720), opens the recipes and saves the finished pages to `public/przepis/{slug}.html`, and Cloudflare serves them as files, without the Worker.

A pilot on 20 recipes gave a median of 0.09 s against 0.96 s from the Worker, and on a phone, with 4x CPU slowdown and slow 4G, an LCP of 1660 ms against 2156 ms. [Exporting all of them](https://github.com/spokospace/zapiszprzepis/pull/722) took 34 seconds: 925 pages, 171 MB of HTML. A change in the database raises a content version, and a cron compares it with the build's version every five minutes and calls a deploy hook if they differ, at most once per 10 minutes and 12 times a day. On 6 November at 12:10 UTC I [switched files on for every recipe](https://github.com/spokospace/zapiszprzepis/pull/723), and at 14:09 UTC [for `/szukaj`](https://github.com/spokospace/zapiszprzepis/pull/726).

The best test was UPER SEO Auditor again. In the morning, with 20 recipes in files, the scan had 6 errors 503 on 444 checked URLs, and Cloudflare logged 82 CPU limit overruns that hour. [In the evening, with all the files live](https://github.com/spokospace/zapiszprzepis/blob/master/docs/test-results.md), 946 of 946 URLs answered 200, with no overruns.

From the files going live until 21:09 UTC the dashboard showed 1.36k Worker invocations and 0 errors. In my sample of 45 URLs with no cookies, one per second, all answered 200 and 31 skipped the Worker.

I do not read these numbers further than they go. Nine hours is a short window at low traffic, and only about 20 of the 946 sitemap URLs reach the Worker. The render still does not fit the limit: median CPU in that window was 38.3 ms and p90 264 ms. Later that evening [the home page became a file too](https://github.com/spokospace/zapiszprzepis/pull/732), but categories, profiles, `/login` and `/_next/image` stayed on the Worker, so under more traffic 1102 could come back there. I also do not know why errors outlasted the load: after a series of 40 recipes production gave 16 errors, and a preview of the same version none.

Files have one trap, and I walked into it the same day. Cloudflare serves them before any code runs, so `http://zapiszprzepis.pl/przepis/zapiekanka` answered 200 with no redirect to HTTPS. Turning on Always Use HTTPS in the zone settings fixed it.

The price is a delay, because a recipe change appears only after the next build. For the first three days that price was higher than I had planned. The trigger that raises the content version ran an `UPDATE` with no `WHERE`, and Supabase loads the `pg_safeupdate` extension for API queries, which rejects them. From 6 to 9 November every recipe write through the API failed: imports broke, the content version stayed at 1, and the automatic file refresh never ran once. Migrations did not catch it, because they run through the Management API without `pg_safeupdate`. It came up during unrelated work, and [the fix](https://github.com/spokospace/zapiszprzepis/pull/749) is an added `WHERE id`.

The site stayed on the Free plan, and Astro was not needed.

## When the database went away {#when-the-database-went-away}

On 9 November Supabase warned that the project had gone over the Free plan limits. I decided the images were to blame and [moved them](https://github.com/spokospace/zapiszprzepis/pull/756) to Cloudflare R2 the same day. The limit had already been passed, though. After the grace period Supabase blocked the project's API until 28 November, and REST answered with a 402.

The images were most of it, but not all. Cached egress, 12.51 GB, really was Storage files. The chart of regular egress, however, shows 300–560 MB a day from PostgREST from 5 November on, against a few MB a day before. That is the day the recipe files went in. The build renders each of the 932 recipes, and each render fetches the "Podobne" (similar recipes) block, two queries of 50 cards each. That is about 35 MB from the database per build, so 300–560 MB a day matches 9–16 builds, and the cron allowed 12 plus merges. The Supabase dashboard does not split egress by query, so this is an inference from the dates and the arithmetic, not from logs. The Free plan's 5 GB a month fits 4–5 such builds a day. The files took the render off the Worker, but every build paid for it in database egress. A shared "Podobne" pool per category should bring that down to about 8 MB, but that is still an estimate from SQL, [not merged yet](https://github.com/spokospace/zapiszprzepis/pull/775).

Recipe files do not need the database, so the block should not have touched them. The build did. On 11 November at 23:51 UTC, merging a docs-only PR started a deploy. The export script could not load the recipe list, printed "skipped", and the build passed. The new version had not a single recipe file, and the Worker could not render recipes without the database, so every recipe answered 404. `pnpm smoke:prod` caught it.

After a rollback to the previous version in the Cloudflare dashboard, 40 of 40 random recipes came back with a 200. What still went through the Worker to Supabase did not work: categories, sign-in, favourites, adding recipes and the sitemap. [The export now stops the build](https://github.com/spokospace/zapiszprzepis/pull/773) when the list does not load or there are files for fewer than 90% of recipes, so the last good version stays live.

The block also showed what else depended on the database. On 24 November the sitemap listed 17 URLs and not a single recipe, because the route read the database on every request and answered 200 with only the fixed pages when the read failed. Profiles answered 500, even for names that do not exist. Both errors went away by themselves when the database came back, and they will not repeat in the next outage: [the sitemap is a file from the build](https://github.com/spokospace/zapiszprzepis/pull/784) since 29 November, and [profiles](https://github.com/spokospace/zapiszprzepis/pull/786) since 1 December.

## The last pages on the Worker {#the-last-pages-on-the-worker}

On the evening of 27 November one Chrome went through the whole site and, on every recipe, followed "Zaloguj się" (sign in) in the gallery, that is `/login?next=/przepis/{slug}`. 646 of those requests ended in error 1102, plus about 300 on category pages. According to [the fix's description](https://github.com/spokospace/zapiszprzepis/pull/787) that one evening caused 943 of the 963 CPU limit overruns in eight days. The recipe files held up; the Worker behind them did not.

On 1 December categories [became files](https://github.com/spokospace/zapiszprzepis/pull/777), with tag filters and further pages working in the browser. The same day profiles moved to files, and plain `/login` is served to guests from the same HTML cache that recipes used earlier. The gallery link now points to plain `/login` with `rel="nofollow"`, and only a click adds the return address.

I checked it after the deploy: all 13 categories, the home page, `/szukaj`, the sitemap with 952 URLs, a sample recipe and a profile answer 200 as files, with no `x-opennext` header. A second request for `/login` comes back with `x-edge-cache: HIT`, so the Worker starts but does not render.

The Worker dashboard for the seven days up to 1 December, 16:58 UTC, shows 30.83k invocations and 943 errors. All of them are "Exceeded CPU Time Limits", and all come from the evening of 27 November, from a single Worker version. The rest of the week had none. Median CPU was 11.48 ms, p90 165 ms and p99 401 ms, so the render still does not fit the limit; fewer requests reach it. I do not take this week as proof for every change: the Supabase block was still on for the first four days, and categories had been files for only a few hours.

What stays on the Worker depends on the reader: sign-in with a return address, favourites, adding recipes and the signed-in overlay. The images stay too. Each of the 24 thumbnails on a category page goes through `/_next/image`, that is through the Worker. That is 6 ms of CPU per image on average, so they are not the main suspect for 1102, but it is still the Worker in the path of every guest.

## Summary {#summary}

- I had the cause in the response body on the first day. The later diagnoses happened because I had not measured where the CPU went.
- A clean run after a revert does not prove that the reverted change was to blame.
- Retries in the smoke test hid the outage that the same test had been showing.
- A load probe on a production site with a CPU limit changes what it measures. I no longer treat a single round as a comparison.
- A median of 13–15 ms was hiding a mean of 86 ms on the recipe page.
- The errors left the pages that stopped going through the Worker. The render still does not fit in 10 ms.
- A render in the build is not free. Each build read 35 MB from the database, and a dozen or so builds a day were enough to use up the Supabase Free plan.
- The static files survived the database block. A build that carried on past a failed export published a version with no recipes at all.
- Every route left on the Worker got its traffic in the end. This time it was `/login` and categories, from one scan on one evening.

## Frequently Asked Questions {#faq}

### What does error code 1102 mean on Cloudflare Workers? {#faq-what-does-error-code-1102-mean-on-cloudflare-workers}

The Worker exceeded a resource limit, usually CPU time, less often memory. The client gets a 503 with the body <code>error code: 1102</code>. In the Cloudflare dashboard it shows up as <strong>Exceeded CPU Time Limits</strong> under Metrics.

### Does waiting for the database count towards the 10 ms limit? {#faq-does-waiting-for-the-database-count-towards-the-10-ms-limit}

No. Only the time the CPU spends running Worker code counts. Waiting on <code>fetch()</code>, KV or a database query does not. In ZapiszPrzepis the budget went on rendering, not on the Supabase queries.

### Why does a median above 10 ms not kill every request? {#faq-why-does-a-median-above-10-ms-not-kill-every-request}

Cloudflare says each isolate has some flexibility for occasional overruns, and execution is terminated when a Worker hits the limit consistently. In my case about 6–8% of requests ended in 1102, even though the median CPU was above the limit.

### Will Workers Paid remove error 1102? {#faq-will-workers-paid-remove-error-1102}

The CPU kind, yes: Paid allows 30 seconds per request by default instead of 10 ms. It will not make the site faster, because the render stays the same, and the 128 MB memory limit applies on both plans and also ends in 1102.


## Sources {#sources}

- [Workers: platform limits](https://developers.cloudflare.com/workers/platform/limits/) — CPU per request, isolate flexibility, error 1102, typical use for server-side rendering
- [Workers: error codes](https://developers.cloudflare.com/workers/observability/errors/) — What 1102 means, and the "Cannot perform I/O on behalf of a different request" error
- [Workers: best practices](https://developers.cloudflare.com/workers/best-practices/workers-best-practices/) — Why request state should not live in module-level variables
- [ZapiszPrzepis: measurements of 4 November](https://github.com/spokospace/zapiszprzepis/blob/master/.ai/runs/2026-11-04-recipe-503-1102-experiment.md)
- [ZapiszPrzepis: Worker usage and a trial static build](https://github.com/spokospace/zapiszprzepis/blob/master/.ai/runs/2026-11-05-worker-usage-and-static-build.md) — 31 days of requests, CPU per route, a build of 925 pages
- [ZapiszPrzepis: research on serving pages](https://github.com/spokospace/zapiszprzepis/blob/master/context/foundation/static-architecture-research-2026-11.md) — Options compared on the Free plan, rejected variants, platform facts
- [ZapiszPrzepis: the static pages plan](https://github.com/spokospace/zapiszprzepis/blob/master/.ai/specs/2026-11-05-static-first-public-site.md)
- [ZapiszPrzepis: measurement log](https://github.com/spokospace/zapiszprzepis/blob/master/docs/test-results.md) — Static files, sitemap scans, load probes and the build outage while the database was blocked
- [ZapiszPrzepis: the Astro pilot and phone measurements](https://github.com/spokospace/zapiszprzepis/blob/exp/astro-pilot/.ai/runs/2026-11-05-mobile-cwv-baseline.md)
