billflare.

Cost optimization · Content tag

Browse cases and guides discussing cost optimization.

14 matching items

Cases · 3

D1

D1 row reads: a $134.14 invoice from unindexed queries.

Justin Ahinon reports that his April 21, 2026 Cloudflare invoice was $134.14, with $127.60 from 127,599,130,859 D1 row reads on a 765,000-row database. He attributes it to full table scans in queries that ran on every page load.

Reported amount · USD

$134.14

Reported cause: Read volumefullstacksveltekit.com
First reported: Latest update:
Workers

RetainDB: a reported $36k bill from a queue loop with 81 users.

Reddit user alameenswe, building RetainDB on Workers, KV, Durable Objects and Queues, reports a Cloudflare bill of about $36k for one month with 81 users; the post body says $35,000. He attributes it to a queue consumer that re-queued async writes, 12 unbatched Durable Object writes per memory write and a kv.list() authentication fallback.

Reported amount · USD

$36,000

per month

Reported cause: Unbounded loopwww.reddit.com
First reported: Latest update:

Guides · 11

GuideDurable ObjectsWorkers

Put the spending ceiling into AI-generated code

Prasenjit Sarkar (@stretchcloud) uses the Durable Objects alarm loop to argue that alarms bill without traffic, that a single console cap cannot cover multi-vendor agent work, and that generated code needs execution quotas, idempotency checks and a kill switch.

GuideWorkersD1Durable ObjectsR2Queues

Cloudflare costs $5 a month, but the bill is not capped

不追高 (@Ariella1213) writes an X article explaining that Workers Paid’s $5 is a minimum, that per-product limits and budget alerts do not cap the account bill, and how denial-of-wallet requests, write amplification, delayed stops and background retries add cost.

GuideAI GatewayWorkers AI

AI Gateway spend limits

Cloudflare documents cost-based budgets on an AI Gateway that block requests, or fall back to a cheaper model, once cumulative spend in a time window reaches the limit.

GuideAccount-wide usage-based productsWorkersDurable ObjectsR2

Optimize costs

Cloudflare lists ways to find and reduce usage-based charges by product.