Reputation: 5163
Let's assume I have a large application handling a significative number of websockets connections on Heroku. To cope with such large demand, the number of dynos is incremented to N
.
How is Heroku's router going to distribute the new incoming websockets connection among the running dynos?
In other words, if one of the dynos is maxed out in websockets connections is Heroku's router going to deviate all the new incoming requests among the other (supposedly) less busy dynos? Or is it still going to use the random assignment as stated in the documentation for http incoming connections?
That would definitely make sense as websockets connections are http connections in the very first instance. However, it would be rather complex to scale a large number of persistent connections evenly among N
running dynos.
Anybody con confirm?
Upvotes: 2
Views: 1352
Reputation: 34327
The page you link to says "Routers use a random selection algorithm for HTTP request load balancing across web dynos." That seems unambiguous. Note that Heroku got in trouble with Rap Genius over exactly this issue, although it was with their older Bamboo stack.
In general, by adding dynos, you should be able to avoid any one dyno ever being overloaded, since websockets does not actually use additional RAM for each additional connection supported. At worst, busier dynos should just suffer from higher latency.
Upvotes: 1