title: How to use PM2 Cluster with Socket IO?
body: <p>I am developing an application that relies completely on Socket.io. As we all know NodeJS by default runs only on one core. Now I would like to scale it across multiple cores. I am finding it difficult to make socketio work with PM2 Cluster Mode. Any sample code would help.</p>
  
  <p>I am using Artillery to test. And when the app runs on single core I get the response while It runs in cluster the response would be NaN</p>
  
  <p><img src="https://i.stack.imgur.com/yq8KA.png" alt="When Ran in a Cluster"></p>
  
  <p><a href="https://i.stack.imgur.com/USj88.png" rel="nofollow noreferrer">When Ran Without Cluster</a></p>