WebSocket limits

I'm trying to understand when I'll hit the Free plan limit using WebSocket. A blog post from two years ago, suggests that as long as a WebSocket is open, there is some billing occurring. But I couldn't figure out to which kind of usage to link this billing. From here: https://blog.cloudflare.com/introducing-websockets-in-workers/ "you’ll be billed wall-clock duration for the entire time the connection is open"
The Cloudflare Blog
Introducing WebSockets Support in Cloudflare Workers
WebSockets are a powerful new addition to the Workers platform that unlocks real-time use cases in your application.
1 Reply
Mackenly
Mackenly9mo ago
My understanding is that by default you're billed wall clock. As in you have a websocket active for an hour you get billed for 3,600 seconds. To save costs there's an option to use a different websocket implementation called the Hybernatable WebSockets API which hybernates your DO when nothing is being processed by the DO. This means that if you have a websocket connected all month long but only send a message every 5 mins, you're only billed wall clock for the time it takes to process the messages, rather than the full time your websocket is connected. As far as billing is concerned, this is a must in order to eliminate unnecessary costs. As a note, durable objects are not available on the free plan, so you will need to upgrade to the $5/m (which does include some monthly usage). See this section on DO pricing: https://developers.cloudflare.com/durable-objects/platform/pricing/#:~:text=Calling%20accept()%20on%20a%20WebSocket%20in%20an%20Object%20will%20incur%20duration%20charges%20for%20the%20entire%20time%20the%20WebSocket%20is%20connected.%20If%20you%20prefer%2C%20use%20state.acceptWebSocket()%20instead%2C%20which%20will%20stop%20incurring%20duration%20charges%20once%20all%20event%20handlers%20finish%20running. Pricing example: https://developers.cloudflare.com/durable-objects/platform/pricing/#example-3 Hibernate: https://developers.cloudflare.com/durable-objects/api/hibernatable-websockets-api/