Skip to content

Commit 0274019

Browse files
committed
Undoing prettier automation part 1
1 parent 433956d commit 0274019

File tree

1 file changed

+12
-32
lines changed

1 file changed

+12
-32
lines changed

src/content/partials/workers/durable_objects_pricing.mdx

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ import { Markdown, GlossaryTooltip } from "~/components";
1111
| Requests | 1 million, + $0.15/million<br/> Includes HTTP requests, RPC sessions<sup>1</sup>, WebSocket messages<sup>2</sup>, and alarm invocations |
1212
| Duration<sup>3</sup> | 400,000 GB-s, + $12.50/million GB-s<sup>4,5</sup> |
1313

14-
<sup>1</sup> Each [RPC session](/workers/runtime-apis/rpc/lifecycle/) is billed
15-
as one request to your Durable Object. Every [RPC method
16-
call](/durable-objects/best-practices/create-durable-object-stubs-and-send-requests/)
17-
on a [Durable Objects stub](/durable-objects/) is its own RPC session and
18-
therefore a single billed request.
14+
<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.
1915

2016
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:
2117

@@ -26,30 +22,14 @@ await foo.baz(); // treated as part of the same RPC session created by calling b
2622
await durableObjectStub.cat(); // billed as a request
2723
```
2824

29-
<sup>2</sup> A request is needed to create a WebSocket connection. There is no
30-
charge for outgoing WebSocket messages, nor for incoming [WebSocket protocol
31-
pings](https://www.rfc-editor.org/rfc/rfc6455#section-5.5.2). For compute
32-
requests billing-only, a 20:1 ratio is applied to incoming WebSocket messages to
33-
factor in smaller messages for real-time communication. For example, 100
34-
WebSocket incoming messages would be charged as 5 requests for billing purposes.
35-
The 20:1 ratio does not affect Durable Object metrics and analytics, which
36-
reflect actual usage.
37-
38-
<sup>3</sup> Application level auto-response messages handled by
39-
[`state.setWebSocketAutoResponse()`](/durable-objects/best-practices/websockets/)
40-
will not incur additional wall-clock time, and so they will not be charged.
41-
42-
<sup>4</sup> Duration is billed in wall-clock time as long as the Object is
43-
active, but is shared across all requests active on an Object at once. Calling
44-
`accept()` on a WebSocket in an Object will incur duration charges for the
45-
entire time the WebSocket is connected. If you prefer, use the [WebSocket
46-
hibernation
47-
API](/durable-objects/best-practices/websockets/#websocket-hibernation-api) to
48-
avoid incurring duration charges once all event handlers finish running.
49-
50-
<sup>5</sup> Duration billing charges for the 128 MB of memory your Durable
51-
Object is allocated, regardless of actual usage. If your account creates many
52-
instances of a single Durable Object class, Durable Objects may run in the same
53-
isolate on the same physical machine and share the 128 MB of memory. These
54-
Durable Objects are still billed as if they are allocated a full 128 MB of
55-
memory.
25+
<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
26+
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.
27+
28+
<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.
29+
30+
<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
31+
`accept()` on a WebSocket in an Object will incur duration charges for the entire time the WebSocket is connected. If you prefer, use the [WebSocket
32+
hibernation API](/durable-objects/best-practices/websockets/#websocket-hibernation-api) to avoid incurring duration charges once all event handlers finish running.
33+
34+
<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
35+
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.

0 commit comments

Comments
 (0)