Skip to content
Docs
Changelog

Limits, cost and when to split

The Workers Paid, Hyperdrive and Neon limits the template runs under, what a daily user costs, why the database is the first bottleneck, and the triggers that would justify a second Worker.

Markdown

Production runs on Workers Paid (ADR-0017) as one Worker (ADR-0020). This page holds the numbers behind both decisions. The production guide covers regions, backups and the monthly bill of a small project.

Limits

LimitValue on Workers PaidWhere the template isSource
CPU per request30 s by default, 5 min at most. "Heavier workloads that handle authentication, server-side rendering, or parse large payloads typically use 10-20 ms."Not measured in production. At 10 to 20 ms: 1,500 times under the default.Workers limits
Memory128 MB per isolate, shared by its concurrent requestsNot measuredsame
Subrequests10,000 per request (50 on Free)A page makes tenssame
Simultaneous outgoing connections6 waiting for response headers; the 7th queuesThe request pool is max: 5 (packages/db/src/index.ts); it queues, it does not failsame
Script size64 MiB uncompressed, no compressed limit since 2026-09-0429,293,272 B of server modules on 2026-11-28, 44% of the limit; the docs chunk is 4,542,362 B of it (ADR-0018)same; changelog
Startup1 sAbout 50 ms locally (ADR-0010)same
Wall timeNone for HTTP while the client is connected; 15 min for cron; 30 s for waitUntilThe cron tick's own deadline is 25 ssame
Requests10 million a month included in the $5; $0.30 per further millionSee costWorkers pricing
CPU price30 million ms a month included; $0.02 per further million msSee costsame
Service binding"zero overhead or added latency", "do not incur additional request fees"; billed as one request plus the CPU of both Workers; depth 32None today. A split would cost the same to run.Service bindings
Hyperdrive origin connectionsAbout 20 on Free; up to 1,500 per configuration on Paid (raised from 100 on 2026-11-11); minimum 5; statements up to 60 s; transaction pooling; client connections not limitedThe configured limit is a per-project setting, not in the repositoryHyperdrive limits, changelog
Neon connections112 at 0.25 CU (7 reserved), 225 at 0.5, 450 at 1, 901 at 2, 1,802 at 4. Hyperdrive uses the direct connection string, so these are the ceiling.The compute size is a per-project settingNeon pooling, Neon with Hyperdrive
Neon compute priceLaunch: $0.106 per CU-hour, autoscaling to 16 CU. Free: 100 CU-hours a month, up to 2 CU.See the databaseNeon plans
WebSocketsNo documented maximum per Worker; 32,768 per Durable ObjectNone todayDurable Object state

Requests per active user per day

Estimates, read from the code's behaviour:

  • Web, about 100. Two visits of 12 navigations each: 2 server-rendered documents (their data is read in process, with no further request), 22 client navigations at 1.5 batched /api/rpc calls (33), 15 mutations, 10 session reads (refetch on window focus with a 15 s stale time), 24 page-view events, 4 web-vitals posts and 5 file operations. That is about 93. Polling exists only on the integrations and billing screens, so nothing runs for every open tab.
  • Mobile, about 80. Five opens of 6 requests (session, first screen, screen views), 20 further screens at 2 requests, 10 mutations. The arithmetic below uses 100.
  • Cron. 1,440 invocations a day whatever the traffic.

Cost by daily users

Daily usersRequests a monthWorker feeHow
1,0003 millionFree plan's ceiling100,000 requests a day ÷ 100. The Free plan's 10 ms CPU cap is under what an SSR or auth request typically uses, which is why the template requires Paid.
3,30010 million$5The included requests: 10,000,000 ÷ 30 ÷ 100
10,00030 millionabout $15$5 + 20 × $0.30 = $11, plus CPU at an assumed mean of 8 ms: 240 million ms, 210 × $0.02 = $4.20
100,000300 millionabout $139$5 + 290 × $0.30 = $92, plus CPU: 2,400 million ms, 2,370 × $0.02 = $47.40

The CPU limit is not in reach: a request would need 30,000 ms, and no RPC or SSR path is within three orders of magnitude. Only a CPU-bound endpoint could meet it; OG rendering is cached and document conversion runs in the browser (ADR-0008). The script would need more than two years of growing by 5 MB a quarter to reach 64 MiB.

The database is the first bottleneck

  • Peak load. Assume 10% of the day's requests in the busiest hour and a 2× burst inside it: requests per second ≈ daily users × 100 × 0.10 ÷ 3,600 × 2 = daily users × 0.0056. That is about 56 a second at 10,000 daily users and 560 at 100,000.
  • Connections. Hyperdrive pools in transaction mode, and each tenant statement is its own short transaction (tenant isolation). With about 3 statements a request at about 3 ms each, a request holds an origin connection for about 10 ms: 560 requests a second need about 6 connections on average and perhaps 30 to 60 in a burst, which fits the 105 usable connections of 0.25 CU. The connection count does not bite; hold time does. One 2 s statement on 50 requests a second is 100 connections. This is why withTenant forbids network I/O and why the job pool has 1.5 s and 2 s timeouts.
  • Compute. At an assumed 1 ms of database CPU per request (three indexed statements, each evaluating the row-level security predicate), 0.25 CU saturates near 250 requests a second, about 45,000 daily users, and 1 CU near 1,000, about 180,000. Replace these with a load test; the order is what matters.
  • Cost. The every-minute cron keeps the compute awake (production guide). 0.25 CU all month is 182 CU-hours: over the Free plan's 100, and $19 a month on Launch. 1 CU is $77 and 4 CU is $310. The database costs more than the Worker at every level in the table above.
  • Search. ILIKE and @@ cannot use an index under row-level security (ADR-0009). A search feature reaches the database's limit long before any Worker limit.

Splitting the API into its own Worker moves none of these: it would open the same connections to the same database.

When a second Worker is justified

Measure before deciding: CPU per request by route from Workers Logs, the raw bundle size, the p95 statement time and Hyperdrive pool errors.

TriggerFirst response
A second team or release cadence, or a third-party or non-JavaScript consumer that needs a versioned API with its own availability goalSplit on the same host (ADR-0019); the contracts are already the interface
An endpoint over about 1 s of CPU at p95, or work over 30 sMove that endpoint to its own Worker, a Queue or a Workflow, not the API
WebSockets or presenceA Durable Object beside the Worker, not the API
Raw Worker bundle over 40 MiB, or startup over 400 msStop compiling docs into the Worker first; split second
Compliance that pins the API and the data to a jurisdiction while pages render globallySplit, with placement on the API Worker
p95 statement over 50 ms, or Hyperdrive "Failed to acquire a connection from the pool"Indexes, compute size, a read replica. A split does not help.

Until one fires, the four seams of ADR-0020 keep the split cheap; they are stated as rules in AGENTS.md.

Key files

Edit on GitHubDocumentation is in English.
Cookie settings
We use essential cookies to make our app work. With your consent, we also use optional cookies to improve your experience.

Read our Cookie Policy and Privacy Policy.