惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
WordPress大学
WordPress大学
小众软件
小众软件
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
腾讯CDC
量子位
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
Scott Helme
Scott Helme
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
Jina AI
Jina AI
Attack and Defense Labs
Attack and Defense Labs
S
SegmentFault 最新的问题
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
Google Online Security Blog
Google Online Security Blog
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
罗磊的独立博客
L
LINUX DO - 最新话题
博客园 - Franky
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
The Last Watchdog
The Last Watchdog
J
Java Code Geeks
AI
AI
C
Cisco Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
Help Net Security
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
I
Intezer
S
Securelist

ServerlessHorrors | Blog

ServerlessHorrors | $46,485.99 ServerlessHorrors | $4,241.69 ServerlessHorrors | ~$1189.420/month ServerlessHorrors | $100,000.420 ServerlessHorrors | $738.420 ServerlessHorrors | $70,000.69 ServerlessHorrors | $22.639,69 ServerlessHorrors | $250/month ServerlessHorrors | $1273.69 $530.19 ServerlessHorrors | $383.69 ServerlessHorrors | $400.69 ServerlessHorrors | $103.26 ServerlessHorrors | $96,280.69 $120,000.420 ServerlessHorrors | $1,300.69 ServerlessHorrors | $11,000.69 ServerlessHorrors | $104,500.123 ServerlessHorrors | $23,000.420 ServerlessHorrors | $3,000.69 ServerlessHorrors | $620.123 ServerlessHorrors | $72,000.999
ServerlessHorrors | $36,000
2026-05-02 · via ServerlessHorrors | Blog

Original post

Conclusion: Fixes deployed. Bill sent to Cloudflare support with full explanation. Unknown if Cloudflare will credit it.


tldr: RetainDB (memory layer for AI agents on Cloudflare Workers + KV + Durable Objects + Queues) with 81 users racked up $36k in one month — 3.13B KV writes ($15,635), 16.62B KV reads ($8,306), 4.01B DO storage rows written ($3,962), 574M KV list ops ($2,870) — caused by three compounding bugs: an infinite queue loop passing write_mode: "async" back into itself, 12 unbatched DO storage.put() calls per memory write, and a kv.list() scan running on 95% of auth requests because legacy keys missed the hash/prefix indexes.


The three bugs:

Bug #1 — Infinite queue loop ($15k): Ingest worker forwarded the original write_mode to its internal API call. async got re-queued every time. Fix: force write_mode: "sync" on internal calls.

Bug #2 — 4B DO writes ($4k): 12 unbatched storage.put() calls per memory write across pending overlay, job state, and acks. Fix: removed all DO writes from ingest worker. Pending overlay TTL handles expiry. Dropped 12 → 2.

Bug #3 — KV list scan on every request ($2.8k): Auth fallback ran kv.list() when hash/prefix lookups missed. Legacy keys missed both indexes — 574M list ops. Fix: LEGACY_API_KEY_SCAN_ENABLED = "false".

Lessons:

  • Never pass user-facing write modes through to internal queue workers. Queue consumer IS the async handler.
  • Durable Object storage.put() is not cheap at scale. Batch everything. Use TTLs instead of explicit deletes.
  • Any fallback that touches kv.list() runs on every request in practice. KV list is $5/million.
  • Set up Cloudflare spending alerts before you need them. There’s no hard spending cap on Workers.