WebSocket hibernation · Content tag
Browse content discussing websocket hibernation.
15 matching items
Guides · 15
Pricing a runaway Cloudflare bill before hard caps ship: Workers loops vs always-awake Durable Objects
Lenny Enderle (@lenny_enderle) prices runaway scenarios from the docs: a Worker looping at 1,000 req/s for a day is about $34 plus the $5 plan, while 1,000 Durable Objects kept awake all month is about $4,050. Until hard caps ship, he lists a per-invocation CPU limit, WebSocket hibernation and your own usage counter as guards.
Robert Chandler: a sync engine on one Durable Object backed by R2
Robert Chandler (@bertie_ai) prices a 100 GB, 1,000-user live-sync workload at about $9 a month on one Durable Object reading immutable 64 KB pages from R2, against his list-price estimates of $190 to $33,500 elsewhere. All figures are his estimates, not bills.
WquGuru: a read-only Cloudflare billing audit prompt
WquGuru (@wquguru) shares a read-only audit prompt that checks account usage, D1 query plans, loops and retries, Durable Object wake-ups, high-priced operations and Worker config, then ranks risks by worst-month cost.
Sentry v11 kept Durable Objects awake for 500 ms after every event
Philip Atkinson (@UnrationalPhil) found that upgrading @sentry/cloudflare to v11 raised his Durable Object alarms from about 25 ms to about 505 ms of wall time, because span streaming sets a 500 ms flush timer; the workaround is traceLifecycle: 'static'.
Moving session storage to Durable Objects: storage is cheap, duration decides
Rain (@sakurain_ai) estimates that 10k sessions (~3 GB) and 100k turns cost $0.60 in requests on Durable Objects, while duration varies 60× between hibernating and pinned objects.
Designing a poker game on Durable Objects so idle time costs nothing
Philip Atkinson describes the architecture of his multiplayer poker game on the Cloudflare Developer Platform and the cost rules he follows: archive finished games out of Durable Object storage, hibernate WebSockets, wake with alarms and treat logging as a cost decision.
How I keep Cloudflare under $5: where surprise bills come from
Ashish Sharma (@sarmaasis) runs several sites on the $5 Workers Paid plan and lists, product by product, the usage patterns he says quietly run up a Cloudflare bill, ending with a 12-item checklist.
Removing unneeded Durable Objects from MCP servers on Workers
Justin (@interjc) describes moving read-only MCP servers from McpAgent, which starts a Durable Object per session, to stateless createMcpHandler, and shares a prompt for auditing Workers bindings and runaway usage patterns.
Outgoing WebSockets don’t hibernate
Fabrizio Lamanna (@fabriziolams) describes building a Twitch giveaway tool on Cloudflare and learning that Durable Objects hibernate incoming WebSockets but not outgoing ones, so an always-on outbound chat connection keeps the object resident and on the bill; he moved that connection to Containers.
A library timer kept Durable Objects from hibernating
Anurag Bhagsain (@abhagsain) says YJS awareness’s internal 3-second setInterval stopped their Durable Objects from hibernating, so duration cost accumulated with every new presentation.
The Ultimate Guide to Cloudflare’s Durable Objects: the pricing section
Ashley Peacock (@ashleypeacock) wrote a long introduction to Durable Objects; its pricing section explains GB-s, why you are billed for the full memory allocation, how WebSocket hibernation and the 20:1 message ratio lower cost, and the storage charges.
Optimize costs
Cloudflare lists ways to find and reduce usage-based charges by product.
WebSocket hibernation with Durable Objects
Cloudflare shows how Durable Objects hibernate WebSocket connections while idle.
FlareCost: Durable Object WebSocket messages bill 20:1, and non-hibernating sockets bill duration
FlareCost's Durable Object WebSocket page says incoming WebSocket messages are billed at a 20:1 ratio for compute requests (100 messages count as 5 requests), outgoing messages and protocol pings are not charged, and accepting a WebSocket without the hibernation API bills duration for the whole connection. Reviewed against official pages on 2026-11-02.
How to keep a Durable Objects dead loop from bankrupting you
karamage explains Durable Objects billing as an hourly hotel, recounts how his own alarm loop pushed the projected usage charge of a personal service from a few yen to nearly ¥8,000 (his figure), and lists four coding rules and two monitoring habits to catch a runaway loop early.