Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's websockets, and yes we do make use of Durable Objects. But we do extensive batching and buffering on top of the raw platform. You can't literally send 120 messages / second to and from 100 concurrent clients. Actually the math tops out at about 8 :).


Can you explain what are the limitations in Durable Objects?


There are a variety of relevant limitations. Some of them are listed here: developers.cloudflare.com/durable-objects/platform/limits/

For this particular problem, it just comes down to CPU time. At the bottom of the stack ws.send() is a syscall and it takes significant time. You can only do so many of these calls per second. We measured it at about 8k/sec a year ago.

With a conservative limit of 2k calls to ws.send() (so that we can stay about about 50% utilization and only use half of the time for calling send), this implies 6 clients at 60 FPS using a naive approach (6 * 6 * 60 = ~2k).

It's not really a DO problem, it's just that doing n^2 messages can't really work in any platform.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: