Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Does cluster support node? #95

lexer opened this Issue · 12 comments

6 participants


Failed to find cluster google group. Does cluster support node?


No, because your polling requests could go to different servers where the sessionId might be unknown.
But we are working on a Socket.IO (0.7) release that allows you scale over multiple processes.

tj commented

nope. like @3rd-Eden mentioned, it's more of an issue of not supporting multiple processes out of the box

@tj tj closed this

Is it still the case with 0.8.4?


@dimux333 yes, it's still the case for 0.8.4, however!

We recently landed the RediStore backend for Socket.IO which does allow you to run cluster together with Socket.IO.
I gave a small demo about this during my session. You can find a working demo of this in my github repo ( which will spawn a cluster of 40 processes with a working

So support is definitely coming, but I was unable to get WebSockets working with Cluster but that could been the lack of time I had to fully investigate this behavior.


Thanks. I'll take a look.


@3rd-Eden & @xepcoh Sorry to revive this thread, but what's the status now? How's the support of with Node's native cluster functionality?

tj commented

@DavidChouinard same thing as before, there's no such thing as "supporting node cluster", it's just the same-old multi-process issue, which you can get around by using redis etc


@DavidChouinard @visionmedia The advised way is to the RedisStore that is inside of Socket.IO ( which will make sure that Socket.IO runs with the native cluster implementation of Nodejs and the leanboost/cluster module.

For usage see my nodejsconf-it example that I posted above.



I copied the /socket/ directory of your repo (thanks!) and ran it. Every worker is spewing this error:

Error: Redis connection to failed - ECONNREFUSED, Connection refused
    at Socket.<anonymous> (/Users/david/Desktop/cluster/node_modules/
    at Socket.emit (events.js:64:17)
    at Array.<anonymous> (net.js:830:27)
    at EventEmitter._tickCallback (node.js:126:26)

Clearly, the workers are failing to connect to Redis.

A bit of hacking around go me to this line:

io.set('store', new RedisStore);

My understanding is that the master is creating a Redis store and imposing (and workers) to use it internally. Am I getting this right?

Am I supposed to somehow start Redis? Why is it failing to connect? Let me know.



@DavidChouinard yes it requires Redis to be installed and running.


@3rd-Eden Got it, thanks.


I've seen people go back and forward on this; can work with multiple processes (including Node native socket on 0.8.0) if RedisStore is used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.