Skip to content

Commit 27945f4

Browse files
[DO] Updating limits to be accurate (#21786)
* Updating Storage products mentioned in Workers docs to be accurate. * Apply suggestions from code review Co-authored-by: marciocloudflare <[email protected]> --------- Co-authored-by: marciocloudflare <[email protected]>
1 parent d7da174 commit 27945f4

File tree

3 files changed

+54
-28
lines changed

3 files changed

+54
-28
lines changed

src/content/docs/d1/platform/limits.mdx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ sidebar:
66

77
---
88

9-
import { Render } from "~/components";
9+
import { Render, Details } from "~/components";
1010

1111
| Feature | Limit |
1212
| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
13-
| Databases | 50,000 (Workers Paid)[^1] / 10 (Free) |
13+
| Databases | 50,000 (Workers Paid)[^1] / 10 (Free) |
1414
| Maximum database size | 10 GB (Workers Paid) / 500 MB (Free) |
1515
| Maximum storage per account | 250 GB (Workers Paid)[^1] / 5 GB (Free) |
1616
| [Time Travel](/d1/reference/time-travel/) duration (point-in-time recovery) | 30 days (Workers Paid) / 7 days (Free) |
1717
| Maximum Time Travel restore operations | 10 restores per 10 minute (per database) |
18-
| Queries per Worker invocation (read [subrequest limits](/workers/platform/limits/#how-many-subrequests-can-i-make)) | 50 (Free) / 1000 (Paid) |
18+
| Queries per Worker invocation (read [subrequest limits](/workers/platform/limits/#how-many-subrequests-can-i-make)) | 50 (Free) / 1000 (Paid) |
1919
| Maximum number of columns per table | 100 |
2020
| Maximum number of rows per table | Unlimited (excluding per-database storage limits) |
2121
| Maximum string, `BLOB` or table row size | 2,000,000 bytes (2 MB) |
@@ -25,20 +25,27 @@ import { Render } from "~/components";
2525
| Maximum characters (bytes) in a `LIKE` or `GLOB` pattern | 50 bytes |
2626
| Maximum bindings per Workers script | Approximately 5,000 [^2] |
2727
| Maximum SQL query duration | 30 seconds [^3] |
28-
| Maximum file import (`d1 execute`) size | 5 GB [^4] |
28+
| Maximum file import (`d1 execute`) size | 5 GB [^4] |
2929

3030
:::note[Batch limits]
3131
Limits for individual queries (listed above) apply to each individual statement contained within a batch statement. For example, the maximum SQL statement length of 100 KB applies to each statement inside a `db.batch()`.
3232
:::
3333

3434
[^1]: The maximum storage per account can be increased by request on Workers Paid and Enterprise plans. See the guidance on limit increases on this page to request an increase.
35-
3635
[^2]: A single Worker script can have up to 1 MB of script metadata. A binding is defined as a binding to a resource, such as a D1 database, KV namespace, environmental variable or secret. Each resource binding is approximately 150-bytes, however environmental variables and secrets are controlled by the size of the value you provide. Excluding environmental variables, you can bind up to \~5,000 D1 databases to a single Worker script.
37-
3836
[^3]: Requests to Cloudflare API must resolve in 30 seconds. Therefore, this duration limit also applies to the entire batch call.
39-
4037
[^4]: The imported file is uploaded to R2. See [R2 upload limit](/r2/platform/limits).
4138

39+
<Details header = "Footnotes" open={true}>
40+
1: The maximum storage per account can be increased by request on Workers Paid and Enterprise plans. See the guidance on limit increases on this page to request an increase.
41+
42+
2: A single Worker script can have up to 1 MB of script metadata. A binding is defined as a binding to a resource, such as a D1 database, KV namespace, environmental variable or secret. Each resource binding is approximately 150 bytes, however environmental variables and secrets are controlled by the size of the value you provide. Excluding environmental variables, you can bind up to \~5,000 D1 databases to a single Worker script.
43+
44+
3: Requests to Cloudflare API must resolve in 30 seconds. Therefore, this duration limit also applies to the entire batch call.
45+
46+
4: The imported file is uploaded to R2. See [R2 upload limit](/r2/platform/limits).
47+
</Details>
48+
4249
Cloudflare also offers other storage solutions such as [Workers KV](/kv/api/), [Durable Objects](/durable-objects/), and [R2](/r2/get-started/). Each product has different advantages and limits. Refer to [Choose a data or storage product](/workers/platform/storage-options/) to review which storage option is right for your use case.
4350

4451
<Render file="limits_increase" product="workers" />

src/content/docs/durable-objects/platform/limits.mdx

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,19 @@ Durable Objects are a special kind of Worker, so [Workers Limits](/workers/platf
2424
| WebSocket message size | 1 MiB (only for received messages) |
2525
| CPU per request | 30 seconds (default) / configurable to 5 minutes of [active CPU time](/workers/platform/limits/#cpu-time) [^4] |
2626

27+
[^1]: Identical to the Workers [script limit](/workers/platform/limits/).
28+
[^2]: Durable Objects both bills and measures storage based on a gigabyte <br/> (1 GB = 1,000,000,000 bytes) and not a gibibyte (GiB). <br/>
29+
[^3]: Accounts on the Workers Free plan are limited to 5 GB total Durable Objects storage.
30+
[^4]: 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. CPU time per request invocation [can be increased](/durable-objects/platform/limits/#increasing-durable-object-cpu-limits).
31+
2732
<Details header="Footnotes" open={true}>
28-
1: Identical to the Workers [script limit](/workers/platform/limits/)
33+
1. Identical to the Workers [script limit](/workers/platform/limits/).
2934

30-
2: Durable Objects both bills and measures storage based on a gigabyte <br/> (1 GB = 1,000,000,000 bytes) and not a gibibyte (GiB). <br/>
35+
2. Durable Objects both bills and measures storage based on a gigabyte <br/> (1 GB = 1,000,000,000 bytes) and not a gibibyte (GiB). <br/>
3136

32-
3: Accounts on the Workers Free plan are limited to 5GB total Durable Objects storage.
37+
3. Accounts on the Workers Free plan are limited to 5GB total Durable Objects storage.
3338

34-
4: 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. CPU time per request invocation [can be increased](/durable-objects/platform/limits/#increasing-durable-object-cpu-limits).
39+
4. 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. CPU time per request invocation [can be increased](/durable-objects/platform/limits/#increasing-durable-object-cpu-limits).
3540
</Details>
3641

3742
### SQL storage limits
@@ -55,21 +60,25 @@ For Durable Object classes with [SQLite storage](/durable-objects/api/storage-ap
5560
| Feature | Limit for class with key-value storage backend |
5661
| ---------------------------------------- | ---------------------------------------------------------------- |
5762
| Number of Objects | Unlimited (within an account or of a given class) |
58-
| Maximum Durable Object classes | 500 (Workers Paid) / 100 (Free) [^1] |
59-
| Storage per account | 50 GB (can be raised by contacting Cloudflare) [^2] |
63+
| Maximum Durable Object classes | 500 (Workers Paid) / 100 (Free) [^5] |
64+
| Storage per account | 50 GB (can be raised by contacting Cloudflare) [^6] |
6065
| Storage per class | Unlimited |
6166
| Storage per Durable Object | Unlimited |
6267
| Key size | 2 KiB (2048 bytes) |
6368
| Value size | 128 KiB (131072 bytes) |
6469
| WebSocket message size | 1 MiB (only for received messages) |
65-
| CPU per request | 30s (including WebSocket messages) [^3] |
70+
| CPU per request | 30s (including WebSocket messages) [^7] |
71+
72+
[^5]: Identical to the Workers [script limit](/workers/platform/limits/).
73+
[^6]: Durable Objects both bills and measures storage based on a gigabyte <br/> (1 GB = 1,000,000,000 bytes) and not a gibibyte (GiB). <br/>
74+
[^7]: 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. CPU time per request invocation [can be increased](/durable-objects/platform/limits/#increasing-durable-object-cpu-limits).
6675

67-
<Details header="Footnotes">
68-
1: Identical to the Workers [script limit](/workers/platform/limits/)
76+
<Details header="Footnotes" open={true}>
77+
5. Identical to the Workers [script limit](/workers/platform/limits/).
6978

70-
2: Durable Objects both bills and measures storage based on a gigabyte <br/> (1 GB = 1,000,000,000 bytes) and not a gibibyte (GiB). <br/>
79+
6. Durable Objects both bills and measures storage based on a gigabyte <br/> (1 GB = 1,000,000,000 bytes) and not a gibibyte (GiB). <br/>
7180

72-
3: 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. CPU time per request invocation [can be increased](/durable-objects/platform/limits/#increasing-durable-object-cpu-limits).
81+
7. 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. CPU time per request invocation [can be increased](/durable-objects/platform/limits/#increasing-durable-object-cpu-limits).
7382
</Details>
7483

7584
<Render file="limits_increase" product="workers" />

src/content/docs/workers/platform/storage-options.mdx

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ head:
99
description: Storage and database options available on Cloudflare's developer platform.
1010
---
1111

12-
import { Render } from "~/components";
12+
import { Render, Details } from "~/components";
1313

1414
Cloudflare Workers support a range of storage and database options for persisting different types of data across different use-cases, from key-value stores (like [Workers KV](/kv/)) through to SQL databases (such as [D1](/d1/)). This guide describes the use-cases suited to each storage option, as well as their performance and consistency properties.
1515

@@ -44,24 +44,34 @@ The following table highlights the performance and consistency characteristics o
4444

4545
| Feature | Workers KV | R2 | Durable Objects | D1 |
4646
| --------------------------- | ------------------------------------------------ | ------------------------------------- | -------------------------------- | --------------------------------------------------- |
47-
| Maximum storage per account | Unlimited<sup>1</sup> | Unlimited<sup>2</sup> | 50 GiB | 250GiB <sup>3</sup> |
47+
| Maximum storage per account | Unlimited [^1] | Unlimited [^2] | Unlimited [^3] | 250 GB [^4] |
4848
| Storage grouping name | Namespace | Bucket | Durable Object | Database |
49-
| Maximum size per value | 25 MiB | 5 TiB per object | 128 KiB per value | 10 GiB per database <sup>4</sup> |
50-
| Consistency model | Eventual: updates take up to 60s to be reflected | Strong (read-after-write)<sup>5</sup> | Serializable (with transactions) | Serializable (no replicas) / Causal (with replicas) |
49+
| Maximum size per value | 25 MiB | 5 TiB per object | 128 KiB per value | 10 GB per database [^5] |
50+
| Consistency model | Eventual: updates take up to 60s to be reflected | Strong (read-after-write) [^6] | Serializable (with transactions) | Serializable (no replicas) / Causal (with replicas) |
5151
| Supported APIs | Workers, HTTP/REST API | Workers, S3 compatible | Workers | Workers, HTTP/REST API |
5252

5353
</table-wrap>
5454

55-
<sup>1</sup> Free accounts are limited to 1 GiB of KV storage.
55+
[^1]: Free accounts are limited to 1 GiB of KV storage.
56+
[^2]: Free accounts are limited to 10 GB of R2 storage.
57+
[^3]: Free accounts are limited to 5 GB of storage for SQLite-backed Durable Objects. 50 GB limit applies for KV-backed Durable Objects. Refer to [Durable Objects limits](/durable-objects/platform/limits/).
58+
[^4]: Free accounts are limited to 5 GB of database storage.
59+
[^5]: Free accounts are limited to 500 MB per database.
60+
[^6]: Refer to the [R2 documentation](/r2/reference/consistency/) for more details on R2's consistency model.
5661

57-
<sup>2</sup> Free accounts are limited to 10 GB of R2 storage.
62+
<Details header= "Footnotes" open = {true}>
63+
1. Free accounts are limited to 1 GiB of KV storage.
5864

59-
<sup>3</sup> Free accounts are limited to 5 GiB of database storage.
65+
2. Free accounts are limited to 10 GB of R2 storage.
6066

61-
<sup>4</sup> Free accounts are limited to 500 MiB per database.
67+
3. Free accounts are limited to 5 GB of storage for SQLite-backed Durable Objects. 50 GB limit applies for KV-backed Durable Objects. Refer to [Durable Objects limits](/durable-objects/platform/limits/).
6268

63-
<sup>5</sup> Refer to the [R2 documentation](/r2/reference/consistency/) for
64-
more details on R2's consistency model.
69+
4. Free accounts are limited to 5 GB of database storage.
70+
71+
5. Free accounts are limited to 500 MB per database.
72+
73+
6. Refer to the [R2 documentation](/r2/reference/consistency/) for more details on R2's consistency model.
74+
</Details>
6575

6676
<Render file="limits_increase" />
6777

0 commit comments

Comments
 (0)