socket.io on clusters: broadcasting to all sockets...

59 views
Skip to first unread message

Kevin Ingwersen (Ingwie Phoenix)

unread,
Apr 11, 2015, 1:37:07 PM4/11/15
to nod...@googlegroups.com
Hey.

So now that I have a plan for scaling my Express app, I am likely going to give my Socket.io service the same treat. But there is a little bit of a concern I have.

Say I have 2 workers for a chat service. A good way to promote that a user logged in is to broadcast to all sockets connected…but how exactly will this work if worker#1 sends the broadcast - will worker#2’s sockets also be affected? I dont know if cluster.fork()’ed processes share the sockets or not…

Kind regards,
Ingwie

Guillermo Rauch

unread,
Apr 11, 2015, 1:51:35 PM4/11/15
to nod...@googlegroups.com

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/08C9570E-EE51-4F86-AF8E-E39A171760BA%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Ingwersen (Ingwie Phoenix)

unread,
Apr 11, 2015, 4:55:31 PM4/11/15
to nod...@googlegroups.com
That couldnt have been simpler - I already use Redis for RMI/RPC…now I can use it to cluster socket.io? Best! :) Thanks for the link.
Reply all
Reply to author
Forward
0 new messages