You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<sup>1</sup> 100 messages per minute comes from the fact that 100 clients
125
-
connect to each DO, and each sends 1 message per minute.
124
+
<sup>1</sup> 100 messages per minute comes from the fact that 100 clients connect to each DO, and each sends 1 message per minute.
126
125
127
-
<sup>2</sup> The example uses 1 second because each Durable Object is active for
128
-
1 second per minute. This can also be thought of as 432 million requests that
129
-
each take 10 ms to execute (4,320,000 seconds).
126
+
<sup>2</sup> The example uses 1 second because each Durable Object is active for 1 second per minute. This can also be thought of as 432 million requests that each take 10 ms to execute (4,320,000 seconds).
on a [Durable Objects stub](/durable-objects/) is its own RPC session and
30
-
therefore a single billed request.
20
+
<sup>1</sup> Each [RPC session](/workers/runtime-apis/rpc/lifecycle/) is billed as one request to your Durable Object. Every [RPC method call](/durable-objects/best-practices/create-durable-object-stubs-and-send-requests/) on a [Durable Objects stub](/durable-objects/) is its own RPC session and therefore a single billed request.
31
21
32
22
RPC method calls can return objects (stubs) extending [`RpcTarget`](/workers/runtime-apis/rpc/lifecycle/#lifetimes-memory-and-resource-management) and invoke calls on those stubs. Subsequent calls on the returned stub are part of the same RPC session and are not billed as separate requests. For example:
33
23
@@ -38,34 +28,13 @@ await foo.baz(); // treated as part of the same RPC session created by calling b
38
28
awaitdurableObjectStub.cat(); // billed as a request
39
29
```
40
30
41
-
<sup>2</sup> A request is needed to create a WebSocket connection. There is no
42
-
charge for outgoing WebSocket messages, nor for incoming [WebSocket protocol
43
-
pings](https://www.rfc-editor.org/rfc/rfc6455#section-5.5.2). For compute
44
-
requests billing-only, a 20:1 ratio is applied to incoming WebSocket messages to
45
-
factor in smaller messages for real-time communication. For example, 100
46
-
WebSocket incoming messages would be charged as 5 requests for billing purposes.
47
-
The 20:1 ratio does not affect Durable Object metrics and analytics, which
48
-
reflect actual usage.
49
-
50
-
<sup>3</sup> Application level auto-response messages handled by
<sup>5</sup> Duration billing charges for the 128 MB of memory your Durable
64
-
Object is allocated, regardless of actual usage. If your account creates many
65
-
instances of a single Durable Object class, Durable Objects may run in the same
66
-
isolate on the same physical machine and share the 128 MB of memory. These
67
-
Durable Objects are still billed as if they are allocated a full 128 MB of
68
-
memory.
31
+
<sup>2</sup> A request is needed to create a WebSocket connection. There is no charge for outgoing WebSocket messages, nor for incoming [WebSocket protocol pings](https://www.rfc-editor.org/rfc/rfc6455#section-5.5.2). For compute requests billing-only, a 20:1 ratio is applied to incoming WebSocket messages to factor in smaller messages for real-time communication. For example, 100 WebSocket incoming messages would be charged as 5 requests for billing purposes. The 20:1 ratio does not affect Durable Object metrics and analytics, which reflect actual usage.
32
+
33
+
<sup>3</sup> Application level auto-response messages handled by [`state.setWebSocketAutoResponse()`](/durable-objects/best-practices/websockets/) will not incur additional wall-clock time, and so they will not be charged.
34
+
35
+
<sup>4</sup> Duration is billed in wall-clock time as long as the Object is active, but is shared across all requests active on an Object at once. Calling `accept()` on a WebSocket in an Object will incur duration charges for the entire time the WebSocket is connected. It is recommended to use the WebSocket Hibernation API to avoid incurring duration charges once all event handlers finish running. For a complete explanation, refer to [When does a Durable Object incur duration charges?](/durable-objects/platform/pricing/#when-does-a-durable-object-incur-duration-charges).
36
+
37
+
<sup>5</sup> Duration billing charges for the 128 MB of memory your Durable Object is allocated, regardless of actual usage. If your account creates many instances of a single Durable Object class, Durable Objects may run in the same isolate on the same physical machine and share the 128 MB of memory. These Durable Objects are still billed as if they are allocated a full 128 MB of memory.
69
38
70
39
</Details>
71
40
@@ -90,21 +59,15 @@ The [Durable Objects Storage API](/durable-objects/api/storage-api/) is only acc
90
59
91
60
<Detailsheader="Footnotes"open={true}>
92
61
93
-
<sup>1</sup> Rows read and rows written included limits and rates match [D1
<sup>1</sup> Rows read and rows written included limits and rates match [D1 pricing](/d1/platform/pricing/), Cloudflare's serverless SQL database.
95
63
96
-
<sup>2</sup> Key-value methods like `get()`, `put()`, `delete()`, or `list()`
97
-
store and query data in a hidden SQLite table and are billed as rows read and
98
-
rows written.
64
+
<sup>2</sup> Key-value methods like `get()`, `put()`, `delete()`, or `list()` store and query data in a hidden SQLite table and are billed as rows read and rows written.
99
65
100
66
<sup>3</sup> Each `setAlarm()` is billed as a single row written.
101
67
102
68
<sup>4</sup> Deletes are counted as rows written.
103
69
104
-
<sup>5</sup> Durable Objects will be billed for stored data until the [data is
Once the data is removed, the object will be cleaned up automatically by the
107
-
system.
70
+
<sup>5</sup> Durable Objects will be billed for stored data until the [data is removed](/durable-objects/best-practices/access-durable-objects-storage/#remove-a-durable-objects-storage). Once the data is removed, the object will be cleaned up automatically by the system.
108
71
109
72
</Details>
110
73
@@ -120,23 +83,15 @@ system.
120
83
121
84
<Detailsheader="Footnotes"open={true}>
122
85
123
-
<sup>1</sup> A request unit is defined as 4 KB of data read or written. A
124
-
request that writes or reads more than 4 KB will consume multiple units, for
125
-
example, a 9 KB write will consume 3 write request units.
86
+
<sup>1</sup> A request unit is defined as 4 KB of data read or written. A request that writes or reads more than 4 KB will consume multiple units, for example, a 9 KB write will consume 3 write request units.
126
87
127
-
<sup>2</sup> List operations are billed by read request units, based on the
128
-
amount of data examined. For example, a list request that returns a combined 80
129
-
KB of keys and values will be billed 20 read request units. A list request that
130
-
does not return anything is billed for 1 read request unit.
88
+
<sup>2</sup> List operations are billed by read request units, based on the amount of data examined. For example, a list request that returns a combined 80 KB of keys and values will be billed 20 read request units. A list request that does not return anything is billed for 1 read request unit.
131
89
132
90
<sup>3</sup> Each `setAlarm` is billed as a single write request unit.
133
91
134
-
<sup>4</sup> Delete requests are unmetered. For example, deleting a 100 KB value
135
-
will be charged one delete request.
92
+
<sup>4</sup> Delete requests are unmetered. For example, deleting a 100 KB value will be charged one delete request.
136
93
137
-
<sup>5</sup> Durable Objects will be billed for stored data until the data is
138
-
removed. Once the data is removed, the object will be cleaned up automatically
139
-
by the system.
94
+
<sup>5</sup> Durable Objects will be billed for stored data until the data is removed. Once the data is removed, the object will be cleaned up automatically by the system.
140
95
141
96
Requests that hit the [Durable Objects in-memory cache](/durable-objects/reference/in-memory-state/) or that use the [multi-key versions of `get()`/`put()`/`delete()` methods](/durable-objects/api/storage-api/) are billed the same as if they were a normal, individual request for each key.
0 commit comments