Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use websockets for events (Client limit) #3

Closed
casdr opened this issue Jun 20, 2016 · 7 comments
Closed

Use websockets for events (Client limit) #3

casdr opened this issue Jun 20, 2016 · 7 comments

Comments

@casdr
Copy link

casdr commented Jun 20, 2016

We're having the issue that we want to run 8 dashboards at the same time. Due to the HTTP client limit, we have to open 2 different browsers to make this work.

Switching to websockets seems like a good idea, first of all it's better for the use case and websockets don't have a client limit.

@terraboops
Copy link

You will hit the same browser-side connection limit. HTTP/2 should fix the issue you are seeing. Until then, it's domain sharding for you.

There may be other good reasons to switch to WebSockets, but this is not one IMHO.

Source:
http://www.browserscope.org/?category=network

On Jun 20, 2016, at 3:16 AM, Cas de Reuver notifications@github.com wrote:

We're having the issue that we want to run 8 dashboards at the same time. Due to the HTTP client limit, we have to open 2 different browsers to make this work.

Switching to websockets seems like a good idea, first of all it's better for the use case and websockets don't have a client limit.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@casdr
Copy link
Author

casdr commented Jun 20, 2016

Ah, seems like the article I read was wrong. Then I'll stay with running 2 seperate browsers :)

@terraboops
Copy link

You can also use a technique called domain sharding. Add DNS entries to your DNS server or local hosts file that all point to the same server. The browser-side limitation is not smart and relies entirely on hostname matching, so it is easy to fool.

For example:

/etc/hosts or c:\Windows\System32\Drivers\etc\hosts

127.0.0.1 dashing-server1
127.0.0.1 dashing-server2
127.0.0.1 dashing-server3

Then you can open 6-10 tabs on each "server" by it's hostname (depending on browser).

http://dashing-server1
http://dashing-server2
http://dashing-server3

@terraboops
Copy link

I'll leave this ticket open for a while, in case anybody wants to discuss moving WebSockets for other reasons.

@tokudan
Copy link

tokudan commented Aug 1, 2016

Why not use Firefox and change the following setting in about:config?
network.http.max-persistent-connections-per-server (default 6, set to e.g. 15)

@kinow
Copy link
Member

kinow commented Aug 1, 2016

@tokudan sometimes changes in the browser are not possible. e.g. when someone from another company, or even an executive, or someone without technical skills need to access the dashboard. Would be nice to have a solution without the user having to change any setting in his browser.

@terraboops
Copy link

terraboops commented Aug 1, 2016

Sometimes a browser change is possible, and I didn't know that this could be done. Thanks for the tip @tokudan!

The only solution to this is domain sharding. On further contemplation, HTTP/2 likely will not solve this problem. WebSockets, I know from experience, suffer the same problem. If you need to make this executive-proof, then use another page that does a 301 redirect or good-old-HTML meta refresh to the sharded domain (dashing-1.dashing.board, dashing-2.dashing.board, etc).

Another option - that is just crazy enough to fix this - would be for new tabs to discover and communicate with the parent window via postMessage, so that the first tab opened would essentially multiplex the connection (SSE or WebSocket). This vastly increases complexity of the base solution, but it would be interesting to add this as a component or dashing-contrib gem. Unfortunately, the current design of Dashing makes it hard to extend or modify core functionality like this (ie: how do you monkey-patch this). This, and many other parts of Dashing, could be refactored to be more extensible.

I am closing this, there are two reasonable solutions suggested. I have linked to this in the Wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants