title: Serving files concurrently to multiple clients in node
body: <p>I'm building a simple HTTP server that serves a fairly large file to clients using streams. I need to serve multiple clients at the same time, and I'm wondering what the simplest way to achieve that is. </p>
  
  <p>My initial feeling is that using the <code>cluster</code> module and forking {num CPUs} processes might be the simplest way.</p>
  
  <pre><code>var StreamBrake = require('streambrake');
  var http = require('http');
  var fs = require('fs');
  
  var server = http.createServer(function(req, res) {
    var stream = fs.createReadStream('/data/somefile');
    stream.pipe(new StreamBrake(10240)).pipe(res);
  });
  
  server.listen(1234, 10);
  </code></pre>
  
  <p><strong>Edit</strong>: To clarify, the issue is that this code won't begin to serve the second client until it has finished serving the first.</p>