carlos8f/buffet

nginx vs buffet?

Closed this issue · 1 comments

Why there are no nginx benches? I've tested it and it turns out that nginx is amazingly fast: ~19K rps compared to ~6K rps on buffet (over clean http).
Another interesting thing is why node can't reach nginx speeds? As far as I know, 6K (some average machine) is almost maximum you can squeeze out from node. Did you discovered - are there ways to boost node's http? What's the weakest link?
Thanks for the great project!

There are nginx benches, but it's disabled out of the box since it requires setup.

On my machine (recent-ish iMac) nginx is indeed faster, but not by as much as your result:

https://gist.github.com/carlos8f/6584020

In my experience node slows down:

  • when EventEmitter is used (with the tradeoff of gaining concurrency)
  • when core http module is used - using net directly results in a boost when you don't require full parsing, keep-alive, etc
  • when single process is used - http deployed with cluster or amino is faster if you have processors to spare.

Also nginx is a ridiculously optimized and focused piece of software, so it's doubtful node will ever equal its speed. But node is interpreted so you trade some speed for being able to endlessly tweak its behavior through js.