Limits
Durable Objects are only available on the Workers Paid plan. Durable Objects limits are the same as Workers Limits, as well as the following limits that are specific to Durable Objects:
Feature | Limit |
---|---|
Number of Objects | Unlimited (within an account or of a given class) |
Maximum Durable Object namespaces | 500 (identical to the script limit) |
Storage per account | 50 GB (can be raised by contacting Cloudflare) 1 |
Storage per class | Unlimited |
Storage per Object | Unlimited |
Key size | 2 KiB(2048 bytes) |
Value size | 128 KiB (131072 bytes) |
WebSocket message size | 1 MiB (only for received messages) |
CPU per request | 30s (including WebSocket messages) 2 |
1 Durable Objects both bills and measures storage based on a gigabyte(1 GB = 1,000,000,000 bytes) and not a gibibyte (GiB).
2 Each incoming HTTP request or WebSocket message resets the remaining available CPU time to 30 seconds. This allows the Durable Object to consume up to 30 seconds of compute after each incoming network request, with each new network request resetting the timer. If you consume more than 30 seconds of compute between incoming network requests, there is a heightened chance that the individual Durable Object is evicted and reset.
How much work can a single Durable Object do?
Durable Objects (DOs) can scale horizontally across many individual Durable Objects.
Each individual Object is inherently single-threaded: think of each DO as a stateful server (or virtual machine) that you can create on-the-fly. As with any server, the number of clients it can serve concurrently will depend on the work (compute and storage operations) it is doing per client.
- An individual Object has a soft limit of 1,000 HTTP requests per second, and potentially over 10k concurrent WebSocket messages per second.
- You can have an unlimited number of individual objects per namespace.
- A simple storage
get()
on a small value that directly returns the response may realize a higher request throughput compared to a Durable Object that (for example) serializes and/or deserializes large JSON values. - Similarly, a Durable Object that performs multiple
list()
operations may be more limited in terms of request throughput.
A Durable Object that receives too many requests will, after attempting to queue them, return an overloaded error to the caller.
How many Durable Objects can I create?
Durable Objects are designed such that the number of individual objects in the system do not need to be limited, and can scale horizontally.
- You can create and run as many separate Durable Objects as you want within a given Durable Object namespace.
- The main limit to your usage of Durable Objects is the total storage limit per account.
- If you need more storage, contact your account team or complete the Limit Increase Request Form and we will contact you with next steps.