billflare.

_alphashark_: per-Worker CPU caps, a spend watchdog and a brake

A six-part thread by @_alphashark_: 144 of 156 Workers had no CPU cap, so the author capped 141 by measured peaks, added an hourly overage watchdog and a one-line brake, and found only an auto-created $10 budget alert.

Products
Workers
Source
Author experience𝕏
Author
@_alphashark_

Key points

  • The author reports 18.4M Worker requests in 90 days and Worker fees of the $5 base plus $0.17 for the last 29 days. Cost was fine, but 144 of 156 Workers had no CPU cap.
  • He notes that on Workers Standard one request can use 30 s of CPU by default and up to 5 minutes if raised; by his estimate, a looping bug hit 1M times costs about $600 in CPU, versus $6 with a 300 ms cap. These are the author's illustrative figures, not a bill.
  • Caps per Worker: 4× its p99.9 or 2× its 29-day peak, whichever is larger. He capped 141 Workers in one run and checked bindings on all of them; a PDF Worker peaking at 32.5 s kept the 30 s default.
  • He then added an hourly watchdog that projects the month's overage and alerts on a 10× spike over the weekly baseline, forced a test alert before trusting it, and keeps a one-line brake that drops a Worker to 10 ms of CPU.
  • Two surprises: his only budget alert was an auto-created $10 one, and one Worker used 68.7% of all CPU time. His API token could not create billing alerts, which needed the dashboard. His closing advice for any Workers Paid account: with no hard spend cap, build your own from limits, alerts and a brake.
  • Official docs (rechecked 2026-10-20): Workers Standard includes 30 million CPU ms per month, then $0.02 per million CPU ms; CPU time per HTTP request defaults to 30 s and can be raised to 5 minutes; the pricing page recommends setting a per-invocation CPU limit in the Wrangler file or dashboard to prevent runaway bills.

Original sources

  1. Published

    Original post

    Read on 𝕏

    A six-part thread by @_alphashark_: 144 of 156 Workers had no CPU cap, so the author capped 141 by measured peaks, added an hourly overage watchdog and a one-line brake, and found only an auto-created $10 budget alert.

    _alphashark_

    @_alphashark_ · Original 𝕏 post

    1/ My Cloudflare account did 18.4M Worker requests in 90 days. Worker fees for the last 29 days were the $5 base plus $0.17. Cost was fine. The ceiling wasn't. 144 of my 156 Workers had no CPU cap. https://t.co/UBXtVYMztO
  2. Part 2: default 30 s CPU per request on Workers Standard, up to 5 minutes; the author's $600 vs $6 loop estimate.

    Read on 𝕏

    _alphashark_

    @_alphashark_ · Original 𝕏 post

    2/ On Workers Standard, one request can burn 30 s of CPU by default, and up to 5 minutes if you raise it. A looping bug hit 1M times costs about $600 in CPU. With a 300 ms cap it's $6. https://t.co/Ixy5S6qyLy
  3. Part 3: caps of 4× p99.9 or 2× the 29-day peak; 141 Workers capped in one run.

    Read on 𝕏

    _alphashark_

    @_alphashark_ · Original 𝕏 post

    3/ One cap doesn't fit every Worker. I gave each one 4x its p99.9 or 2x its 29-day peak, whichever is bigger. 141 capped in one run, bindings checked on all of them. My PDF Worker peaks at 32.5 s, so it kept the 30 s default. https://t.co/Ce0bTabcgG
  4. Part 4: hourly overage projection with 10× spike alerts, a forced test alert and a one-line 10 ms CPU brake.

    Read on 𝕏

    _alphashark_

    @_alphashark_ · Original 𝕏 post

    4/ Then a watchdog. Every hour it projects the month's overage and alerts on a 10x spike over my weekly baseline. I forced a test alert before trusting it. There's also a one-line brake that drops a Worker to 10 ms of CPU. https://t.co/HLHUrUVDEu
  5. Part 5: only an auto-created $10 budget alert; one Worker used 68.7% of CPU time; billing alerts could not be created with his API token.

    Read on 𝕏

    _alphashark_

    @_alphashark_ · Original 𝕏 post

    5/ Two surprises. My only budget alert was an auto-created $10 one. And one Worker used 68.7% of all CPU time. Also, my API token couldn't create billing alerts at all. That part needs the dashboard. https://t.co/UwZyRUXidg
  6. Part 6: what he would set on any Workers Paid account — limits, alerts and a brake, since there is no hard spend cap.

    Read on 𝕏

    _alphashark_

    @_alphashark_ · Original 𝕏 post

    6/ What I'd set on any Workers Paid account. Cloudflare has no hard spend cap, so build your own from limits, alerts and a brake. https://t.co/J2Xyn6SbYO
Author experienceD1 +2

Feng Yi: a free Cloudflare stack still needs an exit map; if a restore into a fresh account takes over 30 minutes, it is cheap but not operationally free

On 2026-11-21, X user @Michael_liyang (Feng Yi) replied to @hiromu_bdy that the free stack still needs an exit map: export D1 to SQL, R2 objects with checksums, and Worker config to version control. Test a restore into a fresh account; if that takes over 30 minutes, the stack is cheap but not operationally free. The 30-minute threshold is the author’s operational test, not an official limit or a billed amount.

Durable Objects

igorrizzom: a forgotten Durable Object alarm billed US$ 2,038; Support refunded US$ 1,533.29, leaving US$ 505.

X user @igorrizzom (Igor Rizzo), who also posted on Cloudflare Community as igorarm (urnaaovivo.com), says a personal, non-commercial prototype that collected public election data in Brazil was left running after the October 25 runoff. A Durable Object kept rescheduling itself via alarm every ~5 seconds and writing to SQLite, and the invoice reached US$ 2,038, almost all from DO rows written, with about 10k pageviews. The author says budget alerts were set up but went to an old inbox that was never checked, and that alerts do not stop usage. Spend limits for Workers and Durable Objects were only announced on November 13, after almost all of the usage; the author then set a US$ 1 spend limit, turned the collector off, and removed Cron Triggers. The author says Support refunded US$ 1,533.29 as a one-time courtesy. The remaining US$ 505, which the author later described as US$ 500 of usage plus the US$ 5 Workers Paid fee, was closed as final; the author asked for a supervisor review in case #02442826 (follow-up to #02435308) and also asked @SidChatterjee whether any goodwill path remained for pre-launch cases. There is no Cloudflare staff reply on the public X thread or the Community thread. Public Support actions are reported by the author.

Author experienceD1 +2

Michael Liyang: record every AI call in D1 and downgrade before the budget runs out

@Michael_liyang argues that on a free tier the danger is not one expensive call but not knowing which call is expensive: write each call's usage to D1 by user and model, have a daily Cron check budgets and downgrade first, and look at which user is burning quota rather than only the total.