Circuit breakers · Content tag
Browse content discussing circuit breakers.
29 matching items
Cases · 5
opsfork: a MeloTTS retry loop produced a $391.50 Workers AI charge; a waiver was requested.
Cloudflare Community user opsfork (newsfork.com) asks for a full waiver of a $391.50 Workers AI charge for the billing period October 21 – November 20, 2026. The author says normal Workers AI spend is about $1–2 per day, but an unexpected incident involving the @cf/myshell-ai/melotts model sharply increased billable usage, mainly on November 18–19. According to the author, MeloTTS was scheduled for deprecation on November 20, 2026, yet repeated model failures began around November 17, before that date; those failures triggered a queue retry mechanism, and a defect in the author’s retry implementation amplified the failures, producing about 3.3 million queued messages. The author says almost all affected inference requests were failed or redundant retries of the same few video rendering jobs and produced no usable output. The author acknowledges responsibility for the retry defect, says the loop has been stopped, and lists safeguards already added, including retry limits, exponential backoff, a circuit breaker, and removal of MeloTTS. Requested resolution includes investigating the pre-deprecation failures, excluding the abnormal usage, waiving the amount attributable to the incident or issuing an equivalent one-time account credit, and a revised invoice; the author is willing to pay legitimate normal-usage charges. A formal billing adjustment request was submitted as Billing Support Case #02445560. Community MVP sjr replied that the author needs to work through the billing ticket and that the Community cannot help with billing issues. There is no Cloudflare staff reply on the public thread.
Reported amount · USD
$391.50
frankzeng2020: Durable Objects ran 1.19 million times against a 1 million monthly allowance, overpaying $0.15.
X user @frankzeng2020 (Frank Zeng) says anti-abuse code written to stop crawlers first exhausted the Cloudflare allowance: Durable Objects ran 1.19 million times against a monthly allowance of 1 million, overpaying 0.15 dollars. The author traces most of the usage to a playback-page heartbeat every 30 seconds plus online stats that called Durable Objects five times, including rejected requests that still hit Durable Objects for a block check; one open page used 430,000 calls in a month. The author also notes a usage-alert email, a D1 scan of 925 million rows in a day, and that a fix (moving the heartbeat off Durable Objects, caching denials at the edge, merging quota checks, and adding a circuit breaker) has been deployed. The $0.15 is the Durable Objects overage; a screenshot of a Workers 800,000-request threshold alert is supporting context only and is not used as the amount.
Reported amount · USD
$0.15
nanyuan0412: an unnoticed bug made a personal site’s database write nonstop, burning $106 in 4 days.
nanyuan0412 says an unnoticed bug in a personal website made the database write nonstop and quietly burned 106 dollars in just 4 days. The attached spend summary shows a total cost of $106.00 for usage observed October 15–26, 2026, all on the D1 Rows Written line, plus a projected cycle cost of $273.83 (a projection, not counted as the reported amount). In a reply the author says they had used the full Cloudflare stack for convenience and that, with no circuit breaker at all, it blew up.
Reported amount · USD
$106
z.calloway43: Litestream R2 loop produced a $25.19 Class A overage.
Community user z.calloway43 requests a one-time courtesy waiver for unpaid invoice IN-75481816 ($25.19) after an unintended Litestream SQLite backup loop on R2 generated about 9.74 million Class A ListObjects operations from a 10-second sync interval and prefix accumulation. The author stopped Litestream, switched to daily Restic snapshots, and added a fail-closed usage guard.
Reported amount · USD
$25.19
burak emre: an agent loop on sandboxes, a $1,000 bill, and support said to pay.
burak emre (@bu7emba) says his agent got into an infinite loop using the AI binding with sandboxes, and within an hour the bill reached about a thousand dollars because new sandboxes spin up fast with no way to rate limit. He says support called it his fault, and later that they had to pay the bill.
Reported amount · USD
$1,000
Guides · 23
Anti-abuse code that burned the Durable Objects allowance: heartbeats, rejected requests and D1 scans
Frank Zeng (@frankzeng2020) says an AI-written anti-abuse module pushed Durable Objects to 1.19 million requests against the 1 million included each month, costing him an extra $0.15; a budget alert email caught it, and the audit also found a D1 query path scanning 925 million rows a day and a signing key re-imported on every request. He shares a read-only self-audit prompt.
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.
EdgeProxy: spend limits and loop detection for AI agents on Cloudflare Workers
Edgeproxy-ai/edgeproxy is an open-source Cloudflare Workers proxy for Anthropic and OpenAI that stops runaway agents with loop detection and per-run dollar budgets before they rack up provider bills. Free to self-host.
QuotaLab: locally test Cloudflare Workers resource budgets before production
ranajahanzaib/cf-quota-lab is an open-source harness that runs representative HTTP workloads against a local Cloudflare Worker, measures D1 and KV usage, projects daily consumption, enforces resource budgets in CI, and injects deterministic dependency failures — without Cloudflare credentials or a deploy.
SpendFuse: a usage checker that converts Cloudflare usage to dollars and can pause a runaway Worker
@hao_ok72927 introduces SpendFuse: after a one-time API token, it installs an open-source agent in your own Cloudflare account, converts Workers, D1, KV and R2 usage to dollars, alerts on budget overruns or spikes, and on paid tiers can pause the offending Worker.
callcthulu/cloudflare-cost-guard: self-hosted usage and subscription monitoring with optional Worker cutoff
An MIT-licensed Python tool that runs on your own Linux host to monitor Cloudflare usage and subscriptions, send budget warnings by email, Telegram, Slack or Discord, and optionally cut off approved stateless Workers. It observes by default and states it is not a spending cap.
A Durable Object alarm loop caught by custom analytics and an agent that shut the deployment down
Aakash Reddy (@aak4shreddy) says a regression left a Durable Object in an alarm loop from a repeatedly polled tool call; his custom Cloudflare analytics sent an overspend webhook and his agent removed the deployment. He says he had misread how Durable Objects duration is billed.
Cloudflare Spend Guard: an account-wide usage circuit breaker via shared KV
A Worker that reads account-wide usage every minute, trips when any monitored metric reaches 95% of a configured allowance, and publishes the state to shared KV for opted-in projects to refuse billable work. The README stresses it is not a hard cap.
_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.
D1 scheduled updates: count runs, not empty queues
wickedev explains how a once-daily full-table update ran hundreds of times a day, and shares the checks he would add after an unexpected D1 bill.
Check getAlarm() first and keep preview off real Durable Objects
@graycoin retells the Durable Object alarm loop shared by @shmily7 and draws three habits: check getAlarm() before setAlarm(), do not bind preview environments to real Durable Objects, and reread AI-generated storage and scheduling code.
Appflare spend protection: per-app usage alerts and automatic pausing in your own account
Appflare, an open-source (Apache-2.0) app manager that runs as a Worker in your own Cloudflare account, added spend protection: it reads each installed app’s usage every 5 minutes, alerts on unusual usage, and can pause an app that runs away.
MultiCloud-MultiPass: a multi-cloud cost kill switch with a Cloudflare provider
An AGPL-3.0 hub, evolved from a GCP cost kill switch, where sub-projects declare expected API usage before calls and report actuals after; overruns can kill the specific job, and a Cloudflare provider can disable Workers or Pages.
Brolly: self-hosted cost guardrails and emergency controls for Cloudflare
Brolly (standardagents/brolly, MIT) is a self-hosted Cloudflare app that watches billable usage across Workers, Durable Objects, D1, R2, KV, Queues and AI, alerts when spend moves out of line, and offers approval-first, reversible quarantine controls; automatic controls are opt-in and it never deletes resources.
cf-usage-guard
An open-source library that reads account usage from the Cloudflare GraphQL API and circuit-breaks individual Worker bindings before overages.
cloudflare-cost-guard
Louis Cai’s open-source rules and TypeScript base class for keeping Durable Object alarms and Worker schedulers from runaway loops.
D1 billing incident and circuit breakers
Nathan Schram describes D1 write risks and circuit-breaker approaches.
How to keep a Durable Objects dead loop from bankrupting you
karamage explains Durable Objects billing as an hourly hotel, recounts how his own alarm loop pushed the projected usage charge of a personal service from a few yen to nearly ¥8,000 (his figure), and lists four coding rules and two monitoring habits to catch a runaway loop early.
Cloudflare Cost Guard: a read-only agent skill for runaway-billing audits
Layer Cache’s open-source agent skill, announced by Domenico (@purposelyblnk), audits a Cloudflare codebase from source alone for paths that can run up uncontrolled billable usage, and reports findings without changing code or calling Cloudflare.
Killowatt: a multi-cloud spend circuit breaker with a Cloudflare suspend adapter
An MIT-licensed circuit breaker that keeps a rolling spend ledger per account, trips when a policy window is exceeded, and on Cloudflare meters Durable Object invocations per script and suspends the Worker behind a tripped account. Enforcement is dry-run until switched on.
CF Usage
An open-source Go server plus Android app that polls Cloudflare GraphQL Analytics every minute, tracks Workers Paid allowances, projects the cycle, alerts, and offers confirmed kill switches.
scram: a self-hosted kill switch for a Cloudflare account
An open-source Worker that prices the account's usage every 15 minutes from the GraphQL Analytics API and, once a spend line is crossed, removes routes and schedules; a restore endpoint puts them back.
A usage circuit breaker for Cloudflare Workers
Yingjie Zhao describes a self-facing circuit breaker that pauses cron jobs on his Workers-based news aggregator as monthly usage nears plan allowances.
Skills · 1
Cloudflare billing risk audit skill
Ask your coding agent to check a Cloudflare project for loops, retries and repeated work that could drive up costs, with code locations and suggested improvements.
daftai-cloudflare-billing-audit