5

I'm curious that I can use both socket.io and Cluster.

I know that cluster uses multi-core to work on node.js with multiple workers.

That means if I use cluster for socket.io, two users with connected on

two different socket.io might cause problem that they cannot communicate each other?

So rather not using cluster on socket.io would be an answer?

jwchang
  • 10,584
  • 15
  • 58
  • 89
  • I have found that using RedisStore would be a solution to solve this problem (using more than one process for socket.io) but how can I implement this? – jwchang Dec 06 '11 at 05:06

1 Answers1

2

Checkout dshaw's talk and sample app regarding scaling Socket.IO: https://github.com/dshaw/talks/tree/master/2011-10-jsclub/sample-app

Also this stackoverflow question might help: How to reuse redis connection in socket.io?

Basically use Redis as a pub-sub with one or multiple channels on which messages are exchanged.

Community
  • 1
  • 1
alessioalex
  • 62,577
  • 16
  • 155
  • 122