node.js - client not handshaken client should reconnect, socket.io in cluster -
my node.js app express, redis, mongo , socket.io works prefectly. today when introduced cluster, found works, there lot of messages app,
'client not handshaken' 'client should reconnect'
many times response time socket.io bad, several seconds.
then used http-proxy front ending requests browsers. chrome works intermittently without throwing such messages. if open same url again, starts throwing these messages , response delayed. firefox behaves same way. randomly, starts throwing these messages continuously.. looks problem websocket in clustered environment.
my node.js version 0.6.10, socket.io 0.9.0, express 2.5.9, http-proxy 0.8.0
this because socket.io keeps connections in memory, each server have it's own set of clients. share socket.io on multiple server instances, using redisstore
. same applies express sessions, have connect-redis
option.
Comments
Post a Comment