My node.js app with express, redis, mongo and socket.io works prefectly.
Today when I introduced cluster, I found that it works, but there are lot of messages by the app,
'client not handshaken' 'client should reconnect'
Many a times the response time from socket.io is very bad, up several seconds.
Then I used http-proxy front ending the requests from the browsers. Chrome works intermittently without throwing up such messages. Sometimes if I open the same URL again, it starts throwing up these messages and response is delayed.
Firefox also behaves the same way. randomly, it starts throwing these messages continuously..
Looks like some problem with websocket in clustered environment.
My node.js version is 0.6.10, socket.io 0.9.0, express 2.5.9, http-proxy 0.8.0
This is most probably because Socket.IO keeps your connections in memory, so each server will have it’s own set of clients. To share Socket.IO over multiple server instances, look into using their
RedisStore. The same applies to Express sessions, where you haveconnect-redisas an option.