Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many websockets can one dyno handle on Heroku?

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.

like image 580
Victor Ronin Avatar asked Jul 27 '14 04:07

Victor Ronin


People also ask

How many requests can a Heroku Dyno handle?

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.

How many connections can Heroku handle?

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.

How many dynos can you have on Heroku?

By default, applications are limited to 100 total dynos across all process types. Additionally, a single process type that uses performance dynos can't be scaled to more than 10 dynos. Submit a request to raise this limit for your application.

Does Heroku support Websockets?

For more details on the WebSocket protocol refer to RFC 6455, which is the version supported on Heroku.


2 Answers

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.

like image 60
Sourav Ghosh Avatar answered Sep 21 '22 13:09

Sourav Ghosh


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

like image 31
Victor Ronin Avatar answered Sep 19 '22 13:09

Victor Ronin