title: Node.JS Response Time
body: <p>Threw Node.JS on an AWS instance and was testing the request times, got some interesting results.</p>
  
  <p>I used the following for the server:</p>
  
  <pre><code>var http = require('http');
  
  http.createServer(function(req, res) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.write('Hello World');
    res.end();
  }).listen(8080);
  </code></pre>
  
  <p>I have an average 90ms delay to this server, but the total request takes ~350+ms. Obviously a lot of time is wasted on the box. I made sure the DNS was cached prior to the test.</p>
  
  <p>I did an Apache bench on the server with a cocurrency of 1000 - it finished 10,000 requests in 4.3 seconds... which means an average of 4.3 milliseconds.</p>
  
  <p><strong>UPDATE: Just for grins, I installed Apache + PHP on the same machine and did a simple "Hello World" echo and got a 92ms response time on average (two over ping).</strong></p>
  
  <p>Is there a setting somewhere that I am missing?</p>