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

Support horizontal scalability #57

Closed
endel opened this issue Jun 17, 2017 · 5 comments
Closed

Support horizontal scalability #57

endel opened this issue Jun 17, 2017 · 5 comments
Assignees
Milestone

Comments

@endel
Copy link
Member

endel commented Jun 17, 2017

Supporting vertical scalability (#43) introduced an architectural change that can be evolved to supporting horizontal scalability in the future.

Match-making should consider sessions living on different servers/processes to determine where the user should connect to.

Communication between servers/processes can be achieved by using either Redis or another message broker such as uTT

In order to achieve horizontal scalability, supporting PM2 for managing processes would be great to have first (#56)

@endel endel modified the milestones: 0.6.0, 0.7.0 Jun 17, 2017
@austinkelleher
Copy link
Contributor

@endel Is there any update on this? I would really like to see this implemented!

@takaaptech
Copy link

@endel Me too, Please add this feature as it is very important in production server!

@endel endel modified the milestones: 1.0.0, 0.9.0 Mar 11, 2018
@endel
Copy link
Member Author

endel commented Mar 14, 2018

I'm starting to experiment with horizontal scalability on branch 0.9.0. I'll update you guys as soon as I have some tangible progress.

@endel
Copy link
Member Author

endel commented Mar 18, 2018

So, the plan for supporting horizontal scalability is basically allowing connections from other processes/servers to communicate with the process which the room actually lives in.

Previously, only the clients connected to the right process (which the room was spawned) could communicate with that room. Now, client connections could live in any process and communicate with the process which the room is living in through Redis PUB/SUB. I'm still not sure this will scale properly since the communication through PUB/SUB will increase considerably, even when it's not really necessary. An extra delay of a couple milliseconds will come to play here.

By removing the ClusterServer implementation, a lot of issues caused by it will not exist anymore, such as #74, #56, #125, #126, and #91.

The good thing about ClusterServer is that it was possible to forward connections from the same server into the right process. Unfortunately, by using multiple processes spread across multiple servers, it's not possible to customize the load balancing algorithm to redirect clients to the right process.

I'd like to have an adapter for memshared as well (endel/memshared#10), so you wouldn't need to have a Redis instance running if you have a single server with multiple processes.

More details coming soon!

@endel endel self-assigned this Mar 18, 2018
@endel endel mentioned this issue Mar 29, 2018
@endel
Copy link
Member Author

endel commented Mar 30, 2018

Redis support implemented on #135

memshared has been implemented too, but still on experimental stage.

@endel endel closed this as completed Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants