I seem to be having an issue where socket.io broadcasts in my node.js app on Heroku don't seem to work when I have more than 1 dyno. As soon as I scale it to 1, it works perfectly. Is there anything I need to know about this? Maybe there is a different way to broadcast to all dynos? Please elt me know if I need to provide more info or code.
Asked
Active
Viewed 2,606 times
1 Answers
5
If you're running on multiple dynos/servers then you have to configure socket.io to use a non-in-memory session store like the RedisStore
. The socket.io documentation has details and there's more discussion here.
-
1Hmm, it seemed to work before but now I see that it works sporadically - sometimes it just gets queued and I get multiple items back all at once. Do you know if there is anything else that needs to be configured or a different call than client.broadcast.to('some room')? – electrichead Feb 25 '13 at 15:35