I am running node v0.12.7 on Debian 7 x64 and I would like to benchmark its performance on a 16 core virtual private server with 4GB of memory.
I am running the following minimalistic code:
// server.js
var http = require('http');
http.createServer(function (request, response) {
res.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World');
}).listen(80,"0.0.0.0");
I am launching it with this command in another teminal):
node server.js
At this point node is running on one core. Then I use ab to test its performance with this command:
ab -n 10000 -c 100 -k http://127.0.0.1/
... and get these results:
...
Requests per second: 3925.81 [#/sec] (mean)
...
Percentage of the requests served within a certain time (ms)
50% 35
...
I was wondering if any of you did similar tests and if you:
- got better results
- got same kind of results but were able to tweak your node app/server in order to obtain higher requests/s and/or lower latency.
I have to mention that running it with pm2 in cluster mode with 15 cores brings me to 4500 requests / second which makes me think that there is another bottle neck somewhere that I miss.
Thanks for any thoughts on this topic. Paul