Lot’s of people are aware that, historically, Heroku is not a good choice for apps that use Websockets. I’m wondering if this has changed in the past 2 years or so.
The first reference I can find to this issue is from back in October 2013
- 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)
For comparison, an entry-level box from Digital Ocean (512MB RAM, Ubuntu 13.10) can handle 350+ new connections/sec, and seems to max out at around 7,200 open connections.
Then as of September 2016, a comment posted in StackOverflow says this
“There are no limitations on the free dyno tier in terms of resources. In terms of concurrent connections there is a theoretical limit of 50 connections per Heroku router instance but we don’t currently publicise the number of router instances running at any one time. In general, for the EU region you can expect to have around 1500 connections available at any given time.” --staff reply to me. Later he clarified, this limit is for all dyno types. even paid ones.
Websocket concurrent connections limit on Heroku - Stack Overflow
1500 connections available at any given time, for all dyno types
I am not even 100% sure what this is precisely. 1500 Websocket connections, ie. 1500 users connected to one channel each? Is this equal to 750 users on two channels each?
As a follow-up I looked into Heroku Router
Each router maintains an internal per-app request counter. On the Common Runtime, routers limit the number of concurrent requests per app. There is no coordination between routers however, so this request limit is per router. The request counter on each router has a maximum size of 50n (n = the number of web dynos your app has running). If the request counter on a particular router fills up, subsequent requests to that router will immediately return an H11 (Backlog too deep) response.
50n where n = the number of web dynos running. So what is appears is we would need an additional Redis instance to manage state across different dynos.
Does anyone know if this is true?