Skip to content

Conversation

@objectiveSee
Copy link

I have forked the chat example and made it work using Cluster. There is an updated README within the example's directory that instructs you on how to configure Redis.

My solution used the sticky-session module (https://github.com/indutny/sticky-session) for routing requests to a slave based on IP address. This means that if you want to test this application, you will need to hit index.html from different machines in order to see requests hitting distinct slaves.

I unfortunately had to drop support for showing the number of connected users in the chat room. In Socket.IO 1.2.0 there will be support for listing the number of connected clients, and therefore being able to get the count (#1630 (comment)).

I would love some feedback from the project maintainers about how I did on using cluster, and whether my solution is in-line with their vision on the best practice for scaling Socket.io across multiple nodes.

@defunctzombie
Copy link
Contributor

I think this is better as a stand alone example for now. That sticky module does not work perfectly (we have noticed delays in connecting) so am not sure we want to promote that yet. Thanks for working on this but I we will keep our current example.

@objectiveSee
Copy link
Author

No worries @defunctzombie! I just joined your socket.io cloud channel on slack. I think we can find some common problems to solve together,

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

Successfully merging this pull request may close these issues.

2 participants