Open
Description
Quick question regarding the Hibernation docs page:
[...] However, as your app grows, maintaining WebSocket connections requires a lot of memory. Hibernation API is a pathway for scaling your app to tens of thousands of connections. It is done by offloading the memory burden from the room process to the PartyKit platform. [...]
Hibernation allows a single room to handle vastly more active connections than it otherwise would:
- Without Hibernation: up to 100 connections per room
- With Hibernation: up to 32,000 connections per room
[...] The limit to scale per room is typically 128MB memory. With Hibernation, the active WebSocket connections no longer count towards your party’s 128MB memory limit
I have two things I'm trying to understand:
- The 100 connections figure seems very low. It implies that each WebSocket connection is taking at least several hundred kilobytes (assuming that the 100 estimate makes room for application data - otherwise 1mb+ per connection). I'd have thought a regular server with 128MB should be able to handle at least a couple of thousand WebSocket connections (even assuming the runtime and application itself takes 50% of that, say)?
- I'm also wondering why the hibernation feature is "tied to" the ability to use the "outer runtime/process" as the holder of the user/client connections. It seems like it would be useful to be able to get the memory savings that come from letting outer runtime handle the sockets, without necessarily wanting to opt into hibernation (e.g. in the "expensive state creation" case mentioned in the doc).
Please forgive me for any slowness/misunderstandings that I have here! 🙏
Metadata
Metadata
Assignees
Labels
No labels