# Billflare billing guides / 计费避坑指南

## Budget alerts / 预算预警

- ID: cloudflare-budget-alerts; kind: official-docs
- [English page](https://billflare.dev/guides/cloudflare-budget-alerts) · [中文页面](https://billflare.dev/zh/guides/cloudflare-budget-alerts)
- Source: Cloudflare Docs / Cloudflare 开发者文档
- Products: Account-wide usage-based products
- [Original source](https://developers.cloudflare.com/billing/manage/budget-alerts/)

Cloudflare documents account-wide spend alerts and their notification limits.

Cloudflare 官方说明账号级费用预警及其通知边界。

- The alert tracks cumulative usage-based spend across the account during the current billing period, then emails the configured recipients after the threshold is crossed. / 预警累计当前账期的账号级用量计费支出；越过设定阈值后，系统向指定收件人发送邮件。
- It sends one notification after crossing the threshold and resets for the next billing period. It does not pause or cap usage; the invoice remains authoritative. / 越过阈值后，预警发送一次通知，并在下个账期重置。它不暂停或限制用量；最终费用以账单为准。
- Cloudflare lists Budget alerts for Pay-as-you-go accounts, not Enterprise contracts. / Cloudflare 将预算预警列为按量付费账号功能，不适用于 Enterprise 合约。

### Thread and updates / 串文与更新

## Cloudflare cost playbook / Cloudflare 成本 Playbook

- ID: cloudflare-cost-playbook; kind: community-resource
- [English page](https://billflare.dev/guides/cloudflare-cost-playbook) · [中文页面](https://billflare.dev/zh/guides/cloudflare-cost-playbook)
- Source: GitHub repository / GitHub 仓库
- Author: KurosawaGeeker / KurosawaGeeker
- Products: Workers, R2
- [Original source](https://github.com/KurosawaGeeker/cloudflare-cost-playbook)

A community playbook for Cloudflare cost retrospectives, cost models, and code review.

围绕 Cloudflare 成本复盘、费用模型与代码审查的社区手册。

- The repository combines incident retrospectives with agent review rules for request paths, polling, caching, and billing alerts. / 仓库把事故复盘与 Agent 审查规则结合，要求检查请求路径、轮询、缓存和账单预警。
- Its calculator distinguishes direct public R2 reads from Worker-proxied reads. A cache hit can avoid an R2 read but still invoke a Worker; the model covers selected Workers and R2 usage, not the whole bill. / 计算器区分直接读取公开 R2 与经 Worker 代理的读取。缓存命中可避免 R2 读取，但仍会调用 Worker；模型只覆盖部分 Workers 与 R2 用量，不代表整张账单。
- The repository provides review material and a calculator template, not a hosted service or a hard spending cap. / 仓库提供审查资料与计算器模板，不提供托管服务或费用硬上限。

### Thread and updates / 串文与更新

## Workers limits / Workers 限制

- ID: cloudflare-workers-limits; kind: official-docs
- [English page](https://billflare.dev/guides/cloudflare-workers-limits) · [中文页面](https://billflare.dev/zh/guides/cloudflare-workers-limits)
- Source: Cloudflare Docs / Cloudflare 开发者文档
- Products: Workers
- [Original source](https://developers.cloudflare.com/workers/platform/limits/)

Cloudflare lists account and invocation limits for Workers.

Cloudflare 官方列出 Workers 账号与单次调用限制。

- CPU time measures Worker execution, not time waiting for fetch, KV, or database responses. / CPU 时间统计 Worker 执行时间，不统计等待 fetch、KV 或数据库响应的时间。
- For HTTP requests, the documented CPU limit is 10 ms on Free and 30 seconds by default on Paid, with a configurable maximum of five minutes. / HTTP 请求的 CPU 限制为 Free 方案 10 毫秒、Paid 方案默认 30 秒，最高可调至 5 分钟。
- Paid CPU limits can be set with Wrangler's limits.cpu_ms or in Dashboard > Workers & Pages > a Worker > Settings. These per-invocation limits do not cap account spend. / Paid 方案可用 Wrangler 的 limits.cpu_ms 或 Dashboard > Workers & Pages > Worker > Settings 设置 CPU 限制。该单次调用限制不封顶账号费用。

### Thread and updates / 串文与更新

## D1 billing incident and circuit breakers / D1 计费事故与熔断复盘

- ID: d1-billing-circuit-breakers; kind: author-experience
- [English page](https://billflare.dev/guides/d1-billing-circuit-breakers) · [中文页面](https://billflare.dev/zh/guides/d1-billing-circuit-breakers)
- Source: Little Bear Apps / Little Bear Apps
- Author: Nathan Schram / Nathan Schram
- Products: D1, Workers
- [Original source](https://littlebearapps.com/blog/d1-billing-disaster-circuit-breakers/)

Nathan Schram describes D1 write risks and circuit-breaker approaches.

Nathan Schram 介绍 D1 写入风险与熔断方式。

- The author describes duplicate work in an embedder and a harvester that reinserted existing rows. He recommends deduplication and INSERT ... ON CONFLICT DO UPDATE for repeated records. / 作者描述了嵌入器重复工作，以及采集器重复插入旧行的问题；他建议增加去重，并用 INSERT ... ON CONFLICT DO UPDATE 更新重复记录。
- His breakers have three scopes: a feature budget for each function in a project, a project budget that aggregates its features, and a global emergency stop across projects. / 作者设计了三层熔断：项目内每项功能有独立预算；项目预算汇总各功能；全局紧急停止覆盖所有项目。
- The article describes operation-count monitoring through wrapped bindings and a Queue-to-Analytics-Engine path, so monitoring does not add D1 writes. A budget check runs about every 30 seconds. / 文章以包装后的绑定统计操作次数，再经 Queue 写入 Analytics Engine，避免监控本身增加 D1 写入；预算约每 30 秒检查一次。

### Thread and updates / 串文与更新

## WebSocket hibernation with Durable Objects / Durable Objects WebSocket 休眠

- ID: durable-objects-websocket-hibernation; kind: official-docs
- [English page](https://billflare.dev/guides/durable-objects-websocket-hibernation) · [中文页面](https://billflare.dev/zh/guides/durable-objects-websocket-hibernation)
- Source: Cloudflare Docs / Cloudflare 开发者文档
- Products: Durable Objects
- [Original source](https://developers.cloudflare.com/durable-objects/examples/websocket-hibernation-server/)

Cloudflare shows how Durable Objects hibernate WebSocket connections while idle.

Cloudflare 官方示例说明 Durable Objects 如何让闲置 WebSocket 连接休眠。

- A Durable Object calls ctx.acceptWebSocket for a server-side socket. When idle, the object can leave memory while the WebSocket connection remains open; a later message recreates the object. / Durable Object 对服务端 WebSocket 调用 ctx.acceptWebSocket。对象闲置时可退出内存，连接仍保持打开；后续消息会重建对象。
- In its constructor, the example retrieves hibernating sockets and restores per-connection state from serialized attachments. / 示例在构造函数中取回休眠中的 WebSocket，并从序列化附件恢复每条连接的状态。
- Hibernation applies only when the Durable Object acts as the WebSocket server; it does not support outbound WebSocket connections. / 只有 Durable Object 作为 WebSocket 服务端时才支持休眠；出站 WebSocket 连接不支持。

### Thread and updates / 串文与更新

## Cloudflare billing pitfalls thread / Cloudflare 计费避坑指南串文

- ID: mcwangcn-billing-thread; kind: author-experience
- [English page](https://billflare.dev/guides/mcwangcn-billing-thread) · [中文页面](https://billflare.dev/zh/guides/mcwangcn-billing-thread)
- Source: 𝕏 / 𝕏
- Author: yvonuk (@mcwangcn) / yvonuk（@mcwangcn）
- Products: Workers, D1, Durable Objects, Email Sending, Containers
- [Original source](https://x.com/mcwangcn/status/2107106092509696292)

The author organizes Cloudflare billing risks by product and shares experience with budget alert emails.

作者按产品整理 Cloudflare 计费风险，并补充预算预警的使用经验。

- The author covers D1, Durable Objects, Workers, Email Sending, and Containers in five numbered posts. / 作者用五篇编号帖子介绍 D1、Durable Objects、Workers、Email Sending 与 Containers。
- The thread links billing risks to full-table writes, request and CPU usage, bot-triggered email, and separate container charges. / 串文分别讨论全表写入、请求与 CPU 用量、机器人触发邮件及独立容器费用。
- A later post adds the author’s experience with delayed budget-alert emails. All collected nodes and their original text appear below. / 后续帖子补充作者遇到预算预警邮件延迟的经历。下方按顺序保留收录节点与原文。

### Thread and updates / 串文与更新
- 2026-10-05: [D1: the author warns that full-table UPDATE statements grow write volume as tables expand, especially when linked to requests. / D1：作者提醒，全表 UPDATE 会随表增长扩大写入量，尤其是与请求绑定时。](https://x.com/mcwangcn/status/2107108280464220179)
- 2026-10-05: [Durable Objects: the author highlights database and request usage as separate billing concerns. / Durable Objects：作者提醒关注数据库用量与请求用量的计费。](https://x.com/mcwangcn/status/2107110284070445346)
- 2026-10-05: [Workers: the author separates request charges from CPU-time charges and describes experience with CPU costs. / Workers：作者区分请求计费与 CPU 时间计费，并提到自己的 CPU 费用经历。](https://x.com/mcwangcn/status/2107153719192350915)
- 2026-10-05: [Email Sending: the author describes bot sign-ups amplifying email usage on a magic-link login flow. / Email Sending：作者描述机器人注册放大 magic link 登录邮件用量。](https://x.com/mcwangcn/status/2107158429831762199)
- 2026-10-05: [Containers: the author explains that container charges are separate from the Workers Paid subscription and reports idle costs from a personal test. / Containers：作者提醒容器费用独立于 Workers Paid 订阅，并介绍自己的闲置测试费用。](https://x.com/mcwangcn/status/2107160249182695729)
- 2026-10-07: [Budget alerts: the author reports emails arriving hours or a day after unexpected usage. / 预算预警：作者报告邮件曾在异常用量发生数小时或一天后才到达。](https://x.com/mcwangcn/status/2107747935718887900)


## Read more
- [index.md](https://billflare.dev/agents/index.md)
- [categories.md](https://billflare.dev/agents/categories.md)
- [tags.md](https://billflare.dev/agents/tags.md)
- [collections.md](https://billflare.dev/agents/collections.md)
- [cases.md](https://billflare.dev/agents/cases.md)
- [guides.md](https://billflare.dev/agents/guides.md)
- [submit.md](https://billflare.dev/agents/submit.md)
- [methodology.md](https://billflare.dev/agents/methodology.md)
- [about.md](https://billflare.dev/agents/about.md)
- [llms.txt](https://billflare.dev/llms.txt)
- [llms-full.txt](https://billflare.dev/llms-full.txt)
