title: Node.js Cluster for Multiple WebSocket Clients Connecting to Different WebSocket Servers?
body: <p>I am using Node.js to implement a Websocket client that subscribes to datafeed from multiple Websocket servers.</p>
  
  <pre><code>foo = new WebSocket('ws://foo.host ...')
  bar = new WebSocket('ws://barhost ...')
  baz = new WebSocket('ws://baz.host ...')
  qux = new WebSocket('ws://qux.host ...')
  
  foo.on('data', data =&gt; doSomething(data))  // 5 events per second 
  bar.on('data', data =&gt; doSomething(data))  // 1 events per second 
  baz.on('data', data =&gt; doSomething(data))  // 1 events per second 
  qux.on('data', data =&gt; doSomething(data))  // 1 events per second 
  </code></pre>
  
  <p><strong>Question:</strong> If we have a multi-core system (eg. 4 cores), is it possible to make use of Node.js Cluster to load balance the processing of the incoming Websocket data, such that each core will approximately receive 2 events per second to be handled?</p>
  
  <p>Or is it better to manually start 8 node.js instances and pass it an argument <em>[foo|bar|baz|qux]</em> for selecting the Websocket server it will connect to?</p>