0

I am running a node.js server with socket.io 0.9. (xhr-polling)

I tried to simulate 300 clients connected to one big room.

I noticed that when I emit one single message to all members in the room, about 40-50 people in the room will be disconnected!

Syntax to emit message to everyone in the room:

io.sockets.in(roomId).emit("abc", "efg");

It is fine if I reduce the number of clients in the room to 100. Emit messages to room won't disconnect them.

This is definitely not acceptable. What is happening?

mkto
  • 4,584
  • 5
  • 41
  • 65
  • How are you simulating 300 clients? Perhaps the simulation + xhr-polling is causing enough delays to cause disconnects. – jfriend00 Jan 08 '15 at 06:38
  • I do noticed that the situation became better if I split my clients on multiple laptops. I am using this piece of code, where multi processes are spawned on laptop and each process simulates one client: https://gist.github.com/Siedrix/5065277. Is there a better way of simulating? – mkto Jan 09 '15 at 01:10
  • I suspect you have some responsiveness issues when you have only a couple processors for 300 clients as each processor can only do one thing at a time. socket.io will disconnect if the connection goes unresponsive. You could increase the heartbeat timeout to a much longer time for this particular test to keep the clients from disconnecting. – jfriend00 Jan 09 '15 at 01:36

0 Answers0