title: packet loss socket io
body: <p>I encountered such a problem. When online, about 1000 people start having problems with socket io. Some messages are not received to the recipients. The loads are approximately the following: a message is sent 2 times per second to all clients. At the moment there is a cluster of 6 servers, all clients are evenly distributed across the socket io servers, but there are still losses. On the server side, I use io + redis socket. PHP sends a message to redis, and then the server on node js reads it and sends it to all clients on sockets. Server Code:</p>
  
  <pre><code>redis.psubscribe('*');
  redis.on('pmessage', (subscribed, channel, message) =&gt; {
      message = JSON.parse(message);
      io.to(channel).emit(channel, message.data);
  });
  
  /**                     SOCKET.IO                   **/
  io.on('connection', socket =&gt; {
      socket.on('subscribe', data =&gt; {
          socket.join(data.channel)
      });
  });
  </code></pre>
  
  <p>What would you advise? Can use redis + socket io not the best option? All traffic goes through cloudflare. Can there be losses because of this?</p>