Reputation: 1640
I've made an app with node.js, socket.io, clusters, redis and it run in 8 processes. Is it possible that each process has a some ghost-sockets? I mean sockets which has already disconnected but not every process knows about it and still has them.
My app send to client an online count(socket count from two rooms) in connection event. And process called "HEAD" send every 3 sec, to all sockets "online count" too. Why Am I telling it? When I connect to app in browser first get "online count" from one of 8 processes, let it be 60, and after 3 sec, i get from HEAD process "online count" but then it is very different number.
So I think some things aren't sync through Redis to processes. Is it possible?
Upvotes: 1
Views: 542
Reputation: 3197
What you want to do is possible but it's a very convoluted way of doing it. Also, considering that you are using node.js, which doesn't have an asynchronous model but polls instead, it would likely be better to poll those connections within node.js which would be straightforward.
Your question is slightly confusing so I hope I understood it well enough.
Upvotes: 1