title: NodeJS on Ubuntu slow?
body: <p>I just installed Ubuntu 10.10 server with NodeJS 0.4.6 using this guide: <a href="http://www.codediesel.com/linux/installing-node-js-on-ubuntu-10-04/" rel="nofollow">http://www.codediesel.com/linux/installing-node-js-on-ubuntu-10-04/</a> on my laptop:</p>
  
  <p>Acer 5920G (Intel Core 2 Duo (2ghz), 4 gb ram)</p>
  
  <p>After that I created a little test how nodejs would perform and wrote this little hello world script:</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>Now to test the performance i used Apache Benchmark on Windows with the following settings</p>
  
  <p><code>ab -r -c 1000 -n 10000 <a href="http://192.168.1.103:8000/" rel="nofollow">http://192.168.1.103:8000/</a></code></p>
  
  <p>But the results are very low compared to <a href="http://zgadzaj.com/benchmarking-node-js-testing-performance-against-apache-php/" rel="nofollow">http://zgadzaj.com/benchmarking-node-js-testing-performance-against-apache-php/</a></p>
  
  <p><pre><code>Server Software:
  Server Hostname:        192.168.1.103
  Server Port:            8000</p>
  
  <p>Document Path:          /
  Document Length:        12 bytes</p>
  
  <p>Concurrency Level:      1000
  Time taken for tests:   23.373 seconds
  Complete requests:      10000
  Failed requests:        0
  Write errors:           0
  Total transferred:      760000 bytes
  HTML transferred:       120000 bytes
  Requests per second:    427.84 [#/sec] (mean)
  Time per request:       2337.334 [ms] (mean)
  Time per request:       2.337 [ms] (mean, across all concurrent requests)
  Transfer rate:          31.75 [Kbytes/sec] received</p>
  
  <p>Connection Times (ms)
                min  mean[+/-sd] median   max
  Connect:        0    1   1.3      1      28
  Processing:  1236 2236 281.2   2327    2481
  Waiting:      689 1522 169.5   1562    1785
  Total:       1237 2238 281.2   2328    2484</p>
  
  <p>Percentage of the requests served within a certain time (ms)
    50%   2328
    66%   2347
    75%   2358
    80%   2364
    90%   2381
    95%   2397
    98%   2442
    99%   2464
   100%   2484 (longest request)</pre></code></p>
  
  <p>Any one got a clue? (Compile, Hardware problem, Drivers, Configuration, Slow script)</p>
  
  <p><b>Edit 4-17 14:04 GMT+1</b>
  I am testing the machine over 1Gbit local connection. When I ping it gives me 0 ms so that would be good I guess. When I issue the apachebenchmark on my Windows 7 machine the CPU raises to 100% :|</p>