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

unsuitable for large / distributed application? #257

Open
Awendel opened this issue Aug 17, 2021 · 2 comments
Open

unsuitable for large / distributed application? #257

Awendel opened this issue Aug 17, 2021 · 2 comments
Labels

Comments

@Awendel
Copy link

Awendel commented Aug 17, 2021

As far as I can tell, all state around connections is handled in memory and exchanged with Clients through the websocket protocol.

Now suppose I have a rather large applications with a load balancer and let's say 20 Servers behind it that the LB routes to.

Wouldn't there be the problem that when opening a Websocket, clients wouldn't "find" each other if they're not connected to the exact machine / websocket connection and hence connections wouldn't be possible?

The only way around it seems to add a centralised database, such as Redis, Memcached or Mongo to share state between Servers?

If that is the case, it would maybe be a good idea to add a disclaimer in the README that it's not suited for distributed / load balanced applications.

@Givemeurcookies
Copy link

Shouldn't be hard to add DB support. Redis is probably the simplest and most fitting.

Though, it's worth to mention that having an open Websocket use very little bandwidth and server resources so you would need to have a significant amount of connections to need a load balancer.

@rushglen
Copy link

rushglen commented Nov 2, 2021

It would be interesting to hear if someone has load tested a peerjs-server, then we might be aware of it's limitations.

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

No branches or pull requests

4 participants