Horizontal Scaling
Hello,
Can anyone please help on how can i have multiple instances of node and socket.io running for horizontal scaling and handling multiple clients? A small research suggested that socket.io handles horizontal scaling but unable to find any specific kind of documentation on it..
Make your nodes share the clients - use the redis store lib I guess Make some type of load-balancer to spread the clients, ex. via: DNS - Google "round robin dns" HAProxy - http://stackoverflow.com/questions/4360221/haproxy-websocket-disconnection/4737648#4737648 Nginx - https://github.com/LearnBoost/socket.io/wiki/Nginx-and-Socket.io Varnish (I guess) - https://github.com/LearnBoost/socket.io/wiki/Varnish-and-Socket.IO
Some other goods links: http://blog.mixu.net/2011/08/13/nginx-websockets-ssl-and-socket-io-deployment/ http://www.letseehere.com/reverse-proxy-web-sockets https://gist.github.com/1014904
Should get you started
Thanks for the reply.. Any approximate of the number of users socket.io and node can handle together at the same time???
With a single-instance? 5000 connections maybe
Edit: nowjs states their lib can handle 6500 connections, it uses socket.io for communication
"Single threaded NowJS can handle up to 6500 concurrent users on the chatroom example For customers that are looking for even greater scalability and reliability, we'll soon be licensing a distributed version of NowJS > currently under development. "
OK... thanks for the information buddy.. but things like nginx and HAproxy are very advanced for me... plus i am already using mongoDB/mongoose for the application. If there is a detail tutorial / documentation for scaling provided by socket.io that would have been great.
Scaling is an advanced topic, so dive into manuals. +1 for HAProxy
Closing this, as it's a question and not a bug. You can hop by our Google groups groups.google.com/group/socket_io/ for questions <3!