Cloudflare Workers 5-Minute CPU Limit Migration Fix Log
Cloudflare Workers Paid plan 5-minute CPU limit migration: wrangler cpu_ms config, $0.02 per million CPU ms pricing, and break-even thresholds vs containers.
Cloudflare Workers Paid plan supports up to 300,000 ms CPU time per request via wrangler cpu_ms, with $0.02 per million CPU ms after 30 million included ms monthly.
Key Numbers & Verified Specs
6 metrics| Metric / Spec | Verified Finding | Source |
|---|---|---|
| Workers Paid CPU time limit per HTTP request | 5 minutes (300,000 ms), default 30 seconds | developers.cloudflare.com |
| Workers Paid CPU time billing rate | $0.02 per million CPU milliseconds after 30 million included ms monthly | developers.cloudflare.com |
| Workers Paid monthly subscription minimum | $5.00 USD per month | developers.cloudflare.com |
| Workers Paid subrequest limit per request | 10,000 subrequests | developers.cloudflare.com |
| Workers Paid simultaneous outgoing connections per request | 6 connections | developers.cloudflare.com |
| Workers Paid egress charge | No charge for data transfer or bandwidth | developers.cloudflare.com |
Jump to section (4) +
Cost & Platform Limits Table
| Feature | Workers Free | Workers Paid | Workers Enterprise |
|---|---|---|---|
| CPU time per HTTP request | 10 ms | 5 min (default: 30 seconds) | 5 min (customizable) |
| CPU time per Cron Trigger | 10 ms | 30s (<1h) / 15 min (>=1h) | 15 min |
| Memory per isolate | 128 MB | 128 MB | 128 MB |
| Subrequests per request | 50 | 10,000 | 10,000+ |
| Simultaneous outgoing connections | 6 | 6 | 6 |
| Monthly subscription | $0 | $5.00 minimum | Contract-based |
| CPU time billing | Included | $0.02 per million CPU ms after 30M included | Contract-based |
| Requests | 100,000/day | No limit (10M included + $0.30 per additional million) | Contract-based |
| Egress / data transfer | No charge | No charge | Contract-based |
| Hourly GPU equivalent | N/A | N/A | N/A |
This table anchors the migration decision. The Paid plan raises CPU time from 10 ms to 300,000 ms per request, but the default remains 30 seconds unless you explicitly opt in via wrangler configuration. Cloudflare Workers platform limits document the Error 1102 termination behavior when a Worker consistently exceeds its configured limit. The pricing page confirms zero egress fees and the $5 monthly minimum that includes 30 million CPU ms and 10 million requests Cloudflare Workers pricing.
Measured Bottlenecks & Hidden Billing Traps
I/O-bound workloads often assume network wait time is free. It is, for CPU billing. However, the 128 MB memory ceiling per isolate is unchanged on the Paid plan. Streaming large payloads through TransformStream avoids buffering the full body in memory, but each subrequest still counts against the 10,000 subrequest limit. Six simultaneous outgoing connections per request create connection pool exhaustion under burst concurrency.
The billing trap is subtle: CPU time is billed only when the Worker runs on a cache miss or bypass. Cached responses do not incur CPU charges, but they still count as requests against the 10 million included monthly allotment. Idle compute wakeups are not a separate line item; you pay for actual CPU milliseconds consumed. Per-step Workflows retries consume additional CPU time and request counts, which can silently multiply costs if a retry loop targets a slow external API.
Cold-start behavior adds latency. Workers startup time is 1 second on both Free and Paid plans. A burst of concurrent invocations can exhaust the six-connection limit per request, causing queued subrequests to fail rather than queue.
Production Configuration Snippet
{
// wrangler.jsonc
"name": "io-bound-worker",
"main": "src/index.ts",
"compatibility_date": "2025-03-25",
"limits": {
"cpu_ms": 300000
},
"observability": {
"enabled": true
}
}// src/index.ts
import { createHash } from 'node:crypto';
export default {
async fetch(request: Request): Promise<Response> {
const url = new URL(request.url);
if (url.pathname !== '/hash') {
return new Response('Not found', { status: 404 });
}
const body = await request.arrayBuffer();
const hash = createHash('sha256').update(body).digest('hex');
return new Response(hash, {
headers: { 'content-type': 'text/plain' }
});
},
};# curl benchmark measuring CPU time via Workers analytics API
# Replace ACCOUNT_ID, API_TOKEN, and SCRIPT_NAME
curl -X GET "https://api.cloudflare.com/client/v4/accounts/ACCOUNT_ID/workers/scripts/SCRIPT_NAME/analytics" \
-H "Authorization: Bearer API_TOKEN" \
-H "Content-Type: application/json" | jq '.result.view[0].cpu_time_ms'# Terraform snippet for Cloudflare Workers route and zone configuration
resource "cloudflare_worker_script" "io_bound" {
name = "io-bound-worker"
content = filebase64("dist/worker.js")
module = true
compatibility_date = "2025-03-25"
}
resource "cloudflare_worker_route" "io_bound_route" {
zone_id = var.zone_id
pattern = "${var.hostname}/hash*"
script_name = cloudflare_worker_script.io_bound.name
}The cpu_ms value of 300000 opts into the full 5-minute CPU budget. Without this key, Workers default to 30 seconds of CPU time even on the Paid plan. Cloudflare's changelog announcement confirms that buggy code protection is the reason for the conservative default.
Migration Checklist & Break-Even Thresholds
- Verify current average CPU time per request in Workers analytics. If average is under 30 ms, the Free plan may remain cheaper despite the 10 ms hard limit causing failures on spikes.
- Set
cpu_msin wrangler.jsonc to match observed p99 CPU time plus 20% headroom, not automatically 300,000 ms. - Configure a Workers spending limit to block new invocations at a defined dollar threshold.
- Test Error 1102 handling by intentionally saturating CPU in a staging Worker.
- Audit subrequest counts against the 10,000 limit for I/O-bound fan-out patterns.
Break-even math: At $0.02 per million CPU milliseconds, 30 million included CPU ms covers roughly 4.29 million requests at 7 ms average CPU time (30,000,000 / 7 = 4,285,714). Beyond that, each additional million CPU ms costs $0.02. The Workers $5 subscription plus $0.02 per million CPU ms overage crosses a container baseline at approximately 45 million CPU ms monthly, assuming 100% container utilization and ignoring egress. That equals 12.5 vCPU-hours at $0.40 per vCPU-hour before platform fees. Cloudflare's zero egress fees shift the threshold higher for data-intensive workloads.
When NOT to use this: CPU-bound workloads exceeding 5 minutes should move to Cloudflare Workflows or Queues, not Workers. The 128 MB memory limit and 6-connection ceiling make Workers unsuitable for large in-memory state or high-concurrency connection pooling.


Cloudflare Workers platform limits define the hard boundaries for CPU time, memory, and subrequests. Cloudflare Workers pricing details the $5 minimum and $0.02 per million CPU ms billing. Cloudflare Workers changelog documents the March 2025 increase from 30 seconds to 5 minutes of CPU time.
Reader Q&A
Frequently Asked Questions
Does waiting on network I/O count toward the 5-minute CPU time limit?
What happens when a Worker exceeds its configured CPU time limit?
Can I set cpu_ms higher than 300,000 for Enterprise workloads?
Bibliography & Verification
Primary Sources & References
Human × Agent Co-Work
Hamdi Soudani · in collaboration with Pyvren
Systems engineer & technical writer exploring AI infrastructure, security, and edge craft in daily collaboration with Pyvren.
Keep Reading
Related Dispatches
Hamdi Soudani × Pyvren
Honest engineering stories — co-crafted with primary benchmarks & real code
Every dispatch blends hands-on engineering judgment with verified primary sources, reproducible configs, and clear tradeoffs.