A benchmark comparison of Node.js, Tornado, and 3 Erlang servers
ostinelli.net
ostinelli.net
However, choosing a tech is much more than just raw numbers. There are so many factors at play and it shouldn't be taken lightly.
That being said, we did something similar about 2 years ago and Erlang/Riak came out so far ahead of the competition for our needs and it wasn't even close.
I did go back to my notes just recently and looked again with Node in mind. Though I didn't do the same bake off we did back then, I did a thorough exercise with Node to make an evaluation and, while a cool tech, would not have made the cut. Erlang/OTP w/ Riak is not hard to program (anyone can learn), takes so much of the guess work out of scalability and is easy to debug. Node isn't quite mature enough to handle this yet and coupled with the true lack of multi-core, can't quite hang with the big boys just yet.
Erlang/OTP is clearly in a league of its own.
http://snapframework.com/blog/2010/11/17/snap-0.3-benchmarks
http://www.yesodweb.com/blog/preliminary-warp-cross-language...
Would be interesting to repeat the author's experiment exactly, but in any case I would expect an order of magnitude upwards difference in performance.
Haskell gives you non-blocking IO without the hassle of callbacks, multithreaded operation and more.
In other words, the slowest of the Erlang servers has twice the throughput of Node.js, and handles server overload much more gracefully (at least in this contrived example).
People use Python and JS-based webservers not for their performance, but because they like the languages. And those languages were designed not for speed or concurrency but for other things, like expresiveness.
Erlang was designed with performance and concurrency in mind, and if it didn't beat the pants off of Python and JS servers, I'd be shocked.
Not that that means it's the right choice for all things. Performance isn't everything, being able to write code in Python is a good enough reason to use something like Django.
I might do so myself if I find the time tomorrow.
EDIT: Give this a listen, the early design and development is described in more detail than I'm capable of going into: http://www.se-radio.net/2008/03/episode-89-joe-armstrong-on-...
But for people who already love JS, node is a dream come true. It's really fast. Not as fast as Erlang, but more than fast enough to justify building massive projects in it. Assuming you are one of those that loves, or believes in, JavaScript...
Async[1] (the waterfall method) and Step[2] come to mind.
The callback issue means that client and server are really not running the same language. They sorta look the same I guess.
That said, code sharing between browser and server often extends to templating, validation and a few utilities, in my experience. More complex logic is better served with message passing or something like dnode.
On top of that, you get nonblocking I/O almost for free, similar to what node attempts to provide, where instead of real nonblocking I/O the system will make blocking I/O look like it's nonblocking. Scala does this too.
But, users of Twisted could also use inLineCallbacks for a similar feel, though it's not required. I'm curious if Node.js could just build the same?
http://steve.vinoski.net/blog/2011/05/09/erlang-web-server-b...
If you have such a massive success that you need the rest of it also ported, then you can make this investment later on. The rest of us simply don't have the time to learn whatever is the fastest each month.
You're not considering that CouchDB views are written in Javascript or that CouchDB uses HTTP as its connection protocol, which has more overhead than the typical binary protocol of traditional DBMSes.
Also, avg. response time in CouchDB is directly proportional to the number of view invalidations that occur. If your data is changing a lot your views will be invalidated frequently and for those requests avg response time will drop significantly. Throw in a reduce function and re-indexing can become an order of magnitude (or more) slower.
In real life a load balancer in front of tornado or node would be a far better solution than going down the erlang road in production.. support and maintenance wise + more programmers out there knowing the language would win hands down IMO...
It performed quite equally to Node.js on my small-scale tests (http://bergie.iki.fi/blog/php_can_perform_better_than_node-j...)
[1] - http://www.yesodweb.com/blog/preliminary-warp-cross-language...
These microbenchmarks don't really do it for me. It would be much more interesting to see a real test application being benchmarked. Something with users, objects, pages that have content.
It would be more fair to look at the code, complexity and performance drops when you actually build something more real.
Also, I know Erlang is awesome and super fast. But personally I would rather spend the money on a good horizontally scalable architecture and extra hardware if that means we can build apps in a more mainstream language like for example Python or Ruby.