Worker Limits: CPU Time, Subrequests, Duration, and Billing
How Cloudflare Workers enforces CPU time and subrequest limits, what wall-clock duration allows, and how Standard pricing bills requests and compute.
This page summarizes Cloudflare Workers documentation on runtime limits, the difference between CPU time and duration (wall-clock time), how limits are raised in Wrangler or the dashboard, and how Workers Standard pricing counts requests and CPU time. Related products (Pages Functions, Durable Objects, Queues, Workflows, Dynamic Workers) inherit the same per-invocation CPU rules unless custom limits apply.
CPU time vs duration: what actually gets limited
Section titled “CPU time vs duration: what actually gets limited”CPU time is how long the CPU spends executing your Worker code. Duration (wall-clock time) is elapsed time from start to end of an invocation, including waiting on network I/O.
CPU time measures how long the CPU spends executing your Worker code. Waiting on network requests (such as fetch() calls, KV reads, or database queries) does not count toward CPU time.
— Cloudflare, Limits — CPU time
Duration measures wall-clock time from start to end of a Worker invocation.
— Cloudflare, Limits — Duration
CPU time is the amount of time the central processing unit (CPU) actually spends doing work, during a given request.
— Cloudflare, Glossary
For HTTP-triggered Workers, duration has no hard cap while the client stays connected; you can stream responses and make subrequests for as long as the connection remains open. Scheduled and queue workloads use different wall-clock caps (see below). Billing for Workers Standard focuses on inbound requests and CPU milliseconds, not on duration (Workers pricing).
| Measure | Counts | Typical use |
|---|---|---|
| CPU time | Loops, parsing, compute in your script | Limit errors (Error 1102), billable compute |
| Duration / wall time | Total elapsed time including fetch() waits |
Long-polling, streaming, slow upstream APIs |
| Subrequests | Each fetch() or binding call to external/internal services |
Fan-out, KV/R2/D1 calls per request |
Account plan limits: Workers Free vs Workers Paid
Section titled “Account plan limits: Workers Free vs Workers Paid”Plan limits define defaults before you override them per Worker. Full tables live in Limits — Account plan limits.
| Feature | Workers Free | Workers Paid |
|---|---|---|
| Requests | 100,000/day (resets midnight UTC) | No general RPS cap; billing quota applies |
| CPU time per HTTP request | 10 ms | Up to 5 min (default 30 s) |
| CPU time per Cron Trigger | 10 ms | 30 s (< 1 h interval) or 15 min (≥ 1 h interval) |
| Subrequests per invocation | 50 | 10,000 (configurable up to 10,000,000) |
| Memory per isolate | 128 MB | 128 MB |
| Workers per account | 100 | 500¹ |
¹ Cloudflare notes 500 on Paid; Workers for Platforms supports many more user Workers for multi-tenant setups.
Daily request limit (Free) and Error 1027
Section titled “Daily request limit (Free) and Error 1027”On Workers Free, exceeding 100,000 requests per day returns Error 1027. Route fail open bypasses the Worker; fail closed returns the error page (Limits — Daily requests).
Subrequests: what counts
Section titled “Subrequests: what counts”A subrequest is any request a Worker makes using the Fetch API or to Cloudflare services like R2, KV, or D1.
— Cloudflare, Limits — Subrequests
Each hop in a redirect chain counts. Within one invocation, operations to external services (including KV/R2) share a 1,000 operations cap on Paid for binding traffic (KV platform limits). Service bindings count toward the subrequest limit and toward a maximum of 32 Worker invocations per top-level request (Service bindings — Limits).
Worker-to-Worker chains are also capped: a Worker cannot invoke itself or another Worker more than 16 times per chain (Errors and exceptions — Loop limit).
Wall time limits by invocation type
Section titled “Wall time limits by invocation type”Wall-clock caps apply to some trigger types, not to ordinary HTTP Workers waiting on clients.
| Invocation type | Wall time limit | Details |
|---|---|---|
| Incoming HTTP request | Unlimited | While client connected; waitUntil() up to 30 s after response/disconnect |
| Cron Triggers | 15 minutes | Per scheduled run |
| Queue consumers | 15 minutes | Per consumer invocation |
| Durable Object alarm handlers | 15 minutes | Per alarm |
| Durable Objects (RPC / HTTP) | Unlimited | While caller stays connected |
| Workflows (per step) | Unlimited | Each step still subject to CPU time limit |
Source: Limits — Wall time limits by invocation type (same table appears under Durable Objects limits and Queues limits).
ctx.waitUntil() runs background work after the response; wall time metrics can include that work (Metrics and analytics — Wall time per execution).
limits.cpu_ms and limits.subrequests: raise or lower caps
Section titled “limits.cpu_ms and limits.subrequests: raise or lower caps”On Workers Paid, you can increase CPU time from the default 30 seconds to 300,000 ms (5 minutes) and adjust subrequests via Wrangler or the dashboard.
Limits are only supported for the Standard Usage Model. Limits are only enforced when deployed to Cloudflare’s network, not in local development. The CPU limit can be set to a maximum of 300,000 milliseconds (5 minutes).
— Cloudflare, Wrangler configuration — Limits
{ "limits": { "cpu_ms": 300000, "subrequests": 150 }}TOML equivalent (cpu_ms, subrequests) is documented on the same page. Dashboard path: Workers & Pages → your Worker → Settings → CPU time limit (Limits — Increasing the CPU time limit).
Durable Objects, Queue consumers, and Workflows use the same limits.cpu_ms pattern on their Wrangler definitions (Durable Objects FAQ, Queues limits, Workflows limits).
Runtime behavior when CPU limit is hit
Section titled “Runtime behavior when CPU limit is hit”Each isolate has some built-in flexibility to allow for cases where your Worker infrequently runs over the configured limit. If your Worker starts hitting the limit consistently, its execution will be terminated according to the limit configured.
— Cloudflare, Limits — CPU time
Charts may show quantiles above your configured CPU limit without errors because of rollover CPU time for requests that stayed under the limit on average (Workers observability metrics, Pages Functions metrics).
Error 1102 and EXCEEDED_CPU: fix CPU-bound Workers
Section titled “Error 1102 and EXCEEDED_CPU: fix CPU-bound Workers”A Cloudflare Worker exceeds a CPU time limit. CPU time is the time spent executing code (for example, loops, parsing JSON, etc). Time spent on network requests (fetching, responding) does not count towards CPU time.
— Cloudflare, Error 1102
When limits are exceeded, clients see Error 1102 (“Worker exceeded resource limits”). Metrics show Exceeded CPU Time Limits / outcome exceededCpu (Limits — Error: exceeded CPU time limit). Email Workers on Free may log EXCEEDED_CPU for heavy handlers (Email service limits).
Documented mitigations:
- Raise
limits.cpu_mson Paid (up to 5 minutes). - Optimize hot paths (fewer loop iterations, leaner JSON parsing, cache computed values).
- Split work across invocations, Durable Objects, or queues.
Custom limits for multi-tenant and Dynamic Workers
Section titled “Custom limits for multi-tenant and Dynamic Workers”Workers for Platforms dispatch Workers can pass per-user caps when resolving a user Worker:
Custom limits allow you to programmatically enforce limits on your customers’ Workers’ resource usage. You can set limits for the maximum CPU time and number of subrequests per invocation. If a user Worker hits either of these limits, the user Worker will immediately throw an exception.
— Cloudflare, Workers for Platforms — Custom limits
Options include cpuMs and subRequests on env.dispatcher.get(). The pricing reference recommends custom limits to control bills and mitigate denial-of-wallet risk.
Dynamic Workers follow the same idea via loader APIs: set limits: { cpuMs, subRequests } in Worker metadata or getEntrypoint(); the lower of two configured limits wins (Dynamic Workers — Custom resource limits). Concurrent distinct Dynamic Workers per request are capped (4 in a Worker, 10 in a Durable Object I/O context) — see Dynamic Workers platform limits.
Workers Standard pricing: requests, CPU time, and what is free
Section titled “Workers Standard pricing: requests, CPU time, and what is free”Paid accounts use the Standard usage model by default (Workers pricing). Core meters:
| Unit | Workers Free | Workers Paid (Standard) |
|---|---|---|
| Subscription | $0 | $5/month minimum |
| Requests | 100,000/day | 10M/month included, +$0.30/million |
| CPU time | 10 ms/invocation | 30M CPU-ms/month included, +$0.02/million CPU-ms |
| Duration | No charge | No charge |
Inbound requests to your Worker. Cloudflare does not bill for subrequests you make from your Worker.
— Cloudflare, Workers pricing — Workers
Requests to static assets are free and unlimited.
— Cloudflare, Workers pricing — Workers
Pages Functions and Workflows requests and CPU time count toward the same Workers quotas (Pages Functions pricing, Workflows pricing). Static asset-only Pages traffic stays free when Functions are not invoked; use _routes.json to exclude static paths (Functions routing, Static assets billing).
Service bindings on Standard pricing: one billed request for the entry Worker; CPU time sums across the binding chain (Workers pricing — Service bindings).
Workers Cache does not add a separate SKU: cached responses still incur the standard request rate; CPU time is billed only when the Worker runs (Workers Cache — Pricing).
Dynamic Workers (Paid only) add a future dimension for unique Workers created per day; request and CPU meters reuse Standard rates (Dynamic Workers pricing). Creation billing was announced with a start date in that document.
Charges accrue when a Worker is bound to a route and runs (How charges accrue — Workers execution).
Other limits that often stack with CPU and subrequests
Section titled “Other limits that often stack with CPU and subrequests”| Topic | Limit | Source |
|---|---|---|
| Memory | 128 MB per isolate; new isolate if exceeded | Limits — Memory |
| Simultaneous connections waiting for headers | 6 per invocation | Limits — Simultaneous open connections |
| Worker startup (global scope) | 1 second CPU | Limits — Worker startup time |
| Cache API calls per request | 50 (Free) / 1,000 (Paid) | Limits — Cache API limits |
| Worker bundle size | 64 MiB (deploy cap 10 MB on Paid per Agents footnote) | Limits — Account plan limits |
Need higher platform limits? Cloudflare points to the Limit Increase Request Form from multiple limits pages (Workers limits).
Common mistakes
Section titled “Common mistakes”- Treating a slow
fetch()as high CPU time — waiting on I/O increases duration, not CPU billing. - Assuming unlimited Free requests on Pages after adding Functions — dynamic invocations share the 100,000/day Workers Free pool (Pages Functions pricing).
- Enabling Workers Cache and expecting static assets or service-binding calls to stay request-free — cache still bills requests at the Standard rate (Workers Cache — Pricing).
- Setting
usage_modelin Wrangler instead of dashboard CPU Limits / Standard settings (Wrangler deprecations). - Hitting subrequest limits in Sandbox SDK with default HTTP transport — many SDK calls equal many subrequests; RPC transport is documented as a mitigation (Sandbox transport — Subrequest limits).
- Upgrading to Paid but still seeing Free Browser Rendering caps until redeploy (Browser Run limits).
How to check this on your site
Section titled “How to check this on your site”- In the Cloudflare dashboard, open Workers & Pages → your Worker → Metrics and review CPU Time per execution, Duration, and errors such as Exceeded CPU Time Limits (Metrics and analytics).
- Confirm Settings → CPU time limit and Usage Model match Workers Standard on Paid (Limits — Increasing the CPU time limit, Workers pricing — How to switch usage models).
- Compare Wrangler
limits.cpu_msandlimits.subrequestswith deployed config (Wrangler configuration — Limits). - For billing estimates, reconcile monthly requests and CPU ms with Workers pricing examples and how charges accrue.
- You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact wording you are asking about.