Set a spending limit for Durable Objects. It applies across your account, rather than to one namespace or object.
To configure a limit, follow Set a spending limit in the dashboard or Manage spending limits and alerts with the cf CLI.
The limit counts usage charges after included usage for:
- Requests and duration.
- SQLite rows read and written.
- Key-value storage reads, writes, and deletes.
Stored data charges and the shared Workers Paid subscription fee are excluded. Stored data can continue to incur charges during a pause.
Once the limit takes effect, Cloudflare blocks these operations:
| Operation | Behavior |
|---|---|
| New requests through a Durable Object stub | Rejected. |
| SQL queries | Reads and writes are rejected. |
| SQLite storage growth | Rejected. |
New alarms through setAlarm() |
Rejected. |
| Pending alarms | Held until the block ends, subject to the seven-day limit described in Alarm recovery. |
An affected operation can return Exceeded the account's spending cap for Durable Objects. A limit does not delete your objects or their stored data.
A limit does not stop every source of charges:
- Requests already running can continue to accrue duration charges.
- Messages on WebSocket connections that are already open are not blocked by the limit.
- Key-value storage operations in legacy key-value-backed objects are not blocked by the limit, even though their charges count toward it.
- Existing stored data continues to incur storage charges.
Usage reporting and enforcement also take time. These limits mean that a limit does not guarantee a maximum invoice amount.
Cloudflare holds pending alarms while the limit blocks the object. These holds do not use the alarm's normal retry budget.
Alarms still within that limit can run once the block ends. Plan for delayed work when restoring service.
Raise the limit above current spend, turn it off, or remove it. Changes can take a few minutes to apply.
The block also expires at the next subscription billing period. An enabled limit remains configured for the new period.
Workers have a separate limit. If the Worker that calls your object is also blocked, restore that Worker before retrying the application.