socketstream/socketstream

load balancing of pub/sub no working as expected

Open

#429 创建于 2014年1月29日

在 GitHub 查看
 (24 评论) (0 反应) (0 负责人)JavaScript (3,557 star) (302 fork)batch import
BugCrucial RequirementTests Neededhelp wanted

描述

Hello!

in the docs (https://github.com/socketstream/socketstream/blob/master/doc/guide/en/pub_sub_events.md#event-transports) I read

"The SocketStream Pub/Sub system has been designed from the ground up with horizontal scalability and high-throughput in mind. The all and channel commands will be automatically load-balanced across all SocketStream servers when an external event transport is used.

This sounds great, but I am experiencing very unexpected results when I let two node instances run on the same server sharing the redis transport. I in fact end up with a scenario where each nodejs server sends all channel messages to all connected clients. I thought the idea was that each nodejs server only sends messages to the sessions it is responsible for. Please point me to where I am doing things wrongly...

Here is the the part where I tell my node app to use the redis transport:

ss.session.store.use( 'redis', scope.serverConf.redis_ss );
ss.publish.transport.use('redis', scope.serverConf.redis_ss);   

scope.serverConf.redis_ss is something like:

redis_ss : {
    host: 'localhost',
    port: 6379,
    db: 4
},

贡献者指南