elad / node-cluster-socket.io

Writeup on how to make node.js cluster and socket.io play nice
421 stars 63 forks source link

Production Use #1

Closed ghost closed 10 years ago

ghost commented 10 years ago

Thank you the research.

I see a small typo bug. It should be var worker = workers[worker_index(connection.remoteAddress, num_processes)];

The scripts works well for me.

elad commented 10 years ago

Thanks! Fixed.

ghost commented 10 years ago

I want to use this code in production. Do you have any recommendation/addition?

elad commented 10 years ago

Yes, there's a caveat, see joyent/node issue #7784. I would wait a bit before using it in production, unless the caveat is insignificant for your scenario.

In some cases the master process seems to not get the connection event causeing the client to hang. If the client retries, it usually succeeds. However this is still unreliable.

If this won't be fixed in the next couple of days I will rewrite the example in this repository using a different approach.

Here's what I have in mind: