Batching telemetry hourly through two Queues to keep R2 writes to about 720 a month
B LLC’s write-up uses two Cloudflare Queues in alternation, routed by UTC hour, and an hourly consumer that compresses each batch into one R2 object. The author says this keeps R2 writes to about 720 a month, inside the free 1 million Class A operations.
- Products
- QueuesR2WorkflowsWorkers
- Source
- Author experiencebellone.com
- Author
- b_llc
Key points
- The producer routes each event to the active queue by its timestamp’s UTC hour using modulo math; a consumer runs every hour on the half-hour, drains the inactive queue, compresses the batch and writes it to R2 with a simple partitioning scheme. UTC avoids DST handling.
- On Hacker News (2026-10-31) the author summarises the pricing logic: R2 bills writes ($4.50 per million), reads ($0.36 per million) and storage ($0.015 per GB-month), with 1 million writes, 10 million reads and 10 GB free a month; batching hourly means about 720 writes a month, leaving storage as the only expense.
- Queue operations themselves are metered separately (Queues pricing), so the batching moves cost from R2 writes to queue operations rather than removing it.
Original sources
Undated
Batching telemetry hourly through two Queues to keep R2 writes to about 720 a month
Open original sourceB LLC’s write-up uses two Cloudflare Queues in alternation, routed by UTC hour, and an hourly consumer that compresses each batch into one R2 object. The author says this keeps R2 writes to about 720 a month, inside the free 1 million Class A operations.
Author comment on the Hacker News submission (submitted 2026-10-28): hourly batching gives about 720 R2 writes a month, eliminating write costs.
Open original source
More to read
AetherGate: a self-hosted OpenAI-compatible gateway on Workers with per-member RPM, TPM and monthly budgets
haiying-ai/aethergate-ai-gateway is an MIT-licensed self-hosted OpenAI-compatible gateway that runs on Cloudflare Workers and D1. It routes one public model name to several upstream providers, issues hashed per-member sk- keys, and enforces RPM, TPM, concurrency and monthly budget policies, with a usage ledger and audit logs. This is an upstream-key control plane, not a substitute for Cloudflare’s own AI Gateway spend limits or account Spend Management.
neoblender13: an AI agent’s recursive alarm system turned a ~$10 monthly Cloudflare bill into $1,500; $400 credited.
neoblender13 says the Cloudflare bill is normally around $10 a month, but this month it was hit with a $1,500 bill because an AI agent created a recursive alarm system that ballooned Durable Objects storage writes, and that Cloudflare support was not very helpful. In later replies the author says they did not realize spending limits were alert only, received a $400 credit and still had to pay $1,100, that the single alert email got buried in the inbox, and that a Discord bot now reports costs every 12 hours.
Turn free allowances into daily budgets with alerts at 70% and 90%
风易 (@Michael_liyang) says 100,000 requests a day and 5 million rows read a day are hard walls, not a safety margin: split production and test into different Workers and D1 databases, alert at 70% and 90%, and degrade before the site returns 500s.