I have socket.io application that must handle a lot of namespaces. I'm wondering what is the limit of the number of namespaces socket.io instance can handle, is there any issue if I'm creating like 10k namespaces. How can I scale to make something like scharding across multiple socket.io instances (each instance handle 1k namespance for example). Actually, I can scale just to support multiple users but all my instances must handle all namespaces.
UPDATE1:
The problem I'm trying to solve is the following, I have a multiplayer card game (like poker) and each room, where 4 players are playing the game, is modeled by socketio namespace. Since I'm expecting thousands of concurrent players, my socketio instance should handle this amount of namespaces. I've already implemented the scalability solution explained in Socket.io website. When I scale out, this node snippet I run in the new instance so it can handle all the namespaces created before.
rooms.forEach(function(room){
var socketRoom = io.of('/room/' + room.id)
.on('connection', function(mySocket){
return handleTableSocket(mySocket, socketRoom, room);
});
});
So is it a good idea to model each game room with socketio namespace? What if the number of namespaces grow up?
Cheers