13

Heroku recently started to support WebSockets

As I understand any runtime application (client side) will keep this WebSocket open to communicate with the server. And the server will have a socket open to communicate with a client side.

Also, As I know Heroku dyno handled just one open socket previous. All requests were handled serially.

Obviously, it's not gonna fly with WebSockets (it will require 100 dynos to server just 100 simultaneous users).

And I can't seem to find info, on how many WebSockets are allowed per dyno for Heroku.

Have you seen any info on this subject?

Update 1

Oh.. I found some unofficial statistics: http://veldstra.org/2013/10/25/heroku-websocket-performance-test.html

Still looking for some more official info.

Victor Ronin
  • 22,758
  • 18
  • 92
  • 184

3 Answers3

4

Maximum WebSocket connection would be limited by their concurrent connection limit and server resource of your dyno.

I contacted Heroku support team and they replied me (Sep 19, 2016):

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."

Later he clarified, this limit is for all dyno types. Even paid ones.

I use NodeJs because it can handle many concurrent connections with low server resource. So, quite a lot users can connect at the same time.

You need to run stress test/load test on your server to get an idea of the limit. There are tools which can help you to run such tests or you can design simple test yourself.

Heroku Routers limit the number of active requests per dyno to 50. There is no coordination between routers, however, so this request limit is per router. I think they also select the routers randomly.

Community
  • 1
  • 1
Sourav Ghosh
  • 1,964
  • 4
  • 33
  • 43
2

Oh.. I found some unofficial statistics: http://veldstra.org/2013/10/25/heroku-websocket-performance-test.html

Victor Ronin
  • 22,758
  • 18
  • 92
  • 184
1

the best: test it with tools like this: https://github.com/observing/thor

Jules Goullee
  • 571
  • 4
  • 11