How many websocket concurrent connections can a single Heroku dyno hold?
I'm running Thin as the web server on top of the Cedar stack with a Ruby framework.
I asked support again (as the latest here was from 2016) and got a similar answer:
There is no hard limit on the number of WebSocket connections per dyno, as you mentioned the limit is 50x connections per router. Giving you an exact figure is complicated as the number of available routers is not static. We have a Router layer that has many machines, and each router can track 50 connections to each Dyno in your app. Unfortunately, we don't publish the number of active routers as this figure scales as our platform reacts to the current inbound traffic.
1500 to 2000 is a decent average estimate with a theoretical upper bound somewhere in the range of 4500. Generally, once you have exhausted the number of concurrent connections, you'll start to receive H11 errors back from Heroku. If you're expecting thousands of concurrent users I would recommend having more than 1 dyno not just to increase the number of WebSocket connections but also because horizontal scaling would add some resiliency to your application.
I've got an answer from Heroku's support:
Hi, Our router will accept 50 simultaneous requests, after which it will send an H11 error. This means each dyno can handle a maximum of 50 open websockets. Please let us know if you still have any doubt or question.
"You can maintain around 6,000 open connections on a single dyno Creating more than 160 connections/sec will cause H11 errors (backlog too deep)"
Take a look to this link:
http://veldstra.org/2013/10/25/heroku-websocket-performance-test.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With