Cloudflare Workers limits that break AI app builders, measured
· 798 words · about 4 min read · minibuildai engineering
Every AI app builder running on Cloudflare hits the same handful of ceilings. Vendor docs tell you the limit; they do not tell you what the failure looks like from the inside. This is the table we wish we had on day one — measured on our own platform, not copied from documentation.
How to read this. "Measured" means observed in our build and deploy logs. "Documented" means the number comes from Cloudflare's published limits. Nothing here is an estimate presented as a measurement.
The table
| Limit | Number | What breaks first | What worked |
|---|---|---|---|
| Durable Object / isolate memory | 128 MB (documented) | Installing a real dependency tree in-process: better-auth + kysely peaked around 500 MB and the isolate was reset mid-build. No deployment row is written, so it presents as a broken product rather than an error. | Build heavy bundles offline, store them in R2 keyed by a content hash of the bundler input, stream the artifact in at deploy time. A hash hit never touches npm. |
| Bundling with esbuild-wasm, no dependency install | ≈63 MB peak (measured) | Nothing — this path is safe. The point is what it tells you about sizing. | Peak memory is dominated by the bundler runtime, not the dependency count. Adding auth and payments moved memory 63.1 → 62.9 → 62.7 MB; it moved time 0.5 s → 2.4 s. Size the runtime, not the package list. |
| SQLite row size inside a Durable Object | 2 MB (documented) | Storing a generated app's module list as one JSON row: a component-heavy app crossed 2 MB and the deploy failed only when a specific app got large. | Store modules as a gzip BLOB. Do the arithmetic before a field can grow with user content — chat history and file trees hit this too. |
| Prebuilt template artifacts | 1.9 MB of modules per login template (measured) | Rebuilding 13 templates on every deploy takes 15–20 minutes; skipping the rebuild means every content hash misses. | Rebuild artifacts in the same step that regenerates the archives, and refuse to ship an artifact whose hash cannot match. |
Native Cloudflare model calls (@cf/…) | ~20 rpm hard cap, 50 unified (documented; measured 28–46 in practice) | Parallel generation hits 429s under load and looks like a model outage. | Use the gateway partner route for the same model where it exists: it bills by token instead of neurons, and we measured 324 rpm with no 429s on Kimi K3. |
| Streaming reasoning through an OpenAI-compatible endpoint | N/A — schema, not a limit | @ai-sdk/openai drops reasoning chunks silently: the thinking never reaches the UI and the model "seems dumb". | Use @ai-sdk/openai-compatible. One line, an afternoon of diagnosis saved. |
Two rules that generalise
1. Anything that can be cached can be moved out of the isolate. Memory limits punish installation, not computation. If a step's input is deterministic, hash it, build it once outside the limit, and ship the artifact.
2. A silent fallback is a latency bomb. Our cache miss fell back to live bundling — correct behaviour, invisible failure. Any fallback that is expensive must log the miss with its hash, or it will eventually take the whole product down and look like a mystery.
How to reproduce these numbers
None of this needs our platform. Each limit is observable from a plain Worker:
- Memory. Log
process.memoryUsage().rsson a timer during a build; the isolate is killed at 128 MB, so the last value written before the reset is the ceiling you hit. On WindowsmaxRSSreports 0 — pollrssinstead. - Bundler peak. Run
esbuild-wasmover the same file set twice with different dependency counts and compare peak RSS. If the numbers are flat while the wall clock moves, memory is the runtime's, not your package list's. - Row size.
SELECT length(json) FROM deploymentstells you how close a row is to 2 MB before it fails; check it on the largest row you have, not the average. - Rate limits. Fire a short burst at the same model from two routes and record the first 429. Twenty concurrent requests is enough to separate a 20 rpm cap from a 300 rpm one.
Publish the number and the method together. A limit quoted without the way it was measured is a rumour.
Why publish this
Because the numbers are not the interesting part — the failure modes are. If you are building an app builder on Cloudflare, this table saves you the two outages it cost us. The longer narrative version, including the cache bug that made the same outage happen twice, is in the 128 MB post.
Measured October–November 2026 on Cloudflare Workers and Durable Objects, us-west region. Model rate limits change without notice; treat those rows as observed, not guaranteed.