How to cap your Cloudflare Workers bill, and what you cannot cap
CostHex concludes there is no dollar cap that stops a Worker, and lays out what can contain a bill instead: per-invocation limits, keeping abusive traffic away, and earlier warnings.
- Products
- WorkersKVD1R2Durable ObjectsQueues
- Source
- Author experienceCostHex
- Author
- CostHex
Key points
- It cites Cloudflare’s wording that budget alerts do not pause or cap usage, and notes threshold billing is not a cap either; it only triggers a mid-cycle invoice.
- Brakes it recommends: set limits.cpu_ms just above normal P99 (over-limit requests fail with error 1102), lower limits.subrequests, set workers_dev to false and serve from a route, add a WAF rate-limiting rule on the costliest path, and put the Rate Limiting binding before KV, D1 and paid APIs.
- For warnings it combines budget alerts at two or three amounts with polling the workersInvocationsAdaptive GraphQL dataset using an Account Analytics Read token. The article ends by promoting CostHex’s own per-minute alerting product.
- Official Workers limits (rechecked 2026-10-14) confirm the 30,000 ms default CPU limit, error 1102 on overrun, and the exceededCpu outcome.
Original sources
Published
How to cap your Cloudflare Workers bill, and what you cannot cap
Open original sourceCostHex concludes there is no dollar cap that stops a Worker, and lays out what can contain a bill instead: per-invocation limits, keeping abusive traffic away, and earlier warnings.
More to read
Video transcription on Cloudflare Containers and Workers AI: a per-hour cost model
Pete Stewart explains why ffmpeg cannot run in a plain Worker, moves it into a scale-to-zero Container, sends audio to Whisper on Workers AI, and works out what each billed component costs.
babynarc: a Durable Objects alarm loop and a surprise bill that grew from $300 to $500.
@babynarc says an alarm loop in an old Durable Object he thought was inactive left him badly burned: he watched a surprise $300 bill grow to $500 even after killing it. Replying to Cloudflare's Dane Knecht and Kenton Varda, he suggests prepending budget-alert details to every `cf` result by default.
How I keep Cloudflare under $5: where surprise bills come from
Ashish Sharma (@sarmaasis) runs several sites on the $5 Workers Paid plan and lists, product by product, the usage patterns he says quietly run up a Cloudflare bill, ending with a 12-item checklist.