WebSocket benchmarks
github.com
github.com
Go is neat and I hope to see it succeed and thrive, but it is simply unavoidable that Erlang has existed for much longer, has been getting tuned for much longer, and this sort of thing is its monomaniacal focus whereas Go is spread a bit more thinly at the moment. Go is trying to be a systems language, Erlang very much isn't.
He also tested with m1.medium instances, which are single cpu. No mention if the instances were 64bit or 32bit (this may matter for Go, as the GC has some issues under 32bit currently).
Tests are hard. Still nice to see a real-world-like comparison between some popular stacks.
Edit: discussion on go-nuts: https://groups.google.com/group/golang-nuts/browse_thread/th...
I will also rerun all the tests on 2 core 64bit instances tonight.
Erlang is significantly more established, but I'm wary of judging technologies on their technological merits alone. Although the technical merits of Erlang are very interesting, I've been quite happy with my experiences using Go.
If you don't know why, then it's better not to post them until you figure out the bottlenecks. There could be factors in your environment that can affect one language and not the other which you are not aware of. Publishing such number will confuse people.
Pretty surprised to see node.js behave so poorly. We had discussions recently at where I work as to what server solution we should use for a multiplayer platform, and as I had recently built a socket/connection handling server in C they asked what I thought about node.js, and my only concern was that if the underlying code uses select(), then it's going to be a poor choice...but I don't think anyone got around to testing it.
search for: C10K for more information
Solutions like node.js, python, etc.. copy strings and buffers all the time and this can slow down the server considerably. They don't have an honest iov layer that won't copy data before passing it to writev and you cannot manage your own memory and create memory pools. These factors can have a bigger impact on performance than selecting the right poller.
Honestly I think CPU or syscall overhead is a more likely culprit.
Write a web server in C and a web server in python/erlang/go/node.js. You'll notice that the one written in C (or C++) runs twice as fast. If it was a syscall bottleneck then they'd achieve the same performance.
zero-copy request handling is not possible in high level languages without hacking.
For a quick test, run httperf against the dumbest node.js web server that returns 204.
Then run the same test against an nginx server that does nothing but return a 204
location / { return 204; }
Compare the difference.
Erlang's IO stack if just fantastic for this and is generally very well optimized. If you want to go even faster you can code the fast path in C/C++ and call out to a higher level language as needed. A little dated but helpful: http://www.metabrew.com/article/a-million-user-comet-applica...
I think that Webbit is also pretty good, this benchmark is little contrived.
Wondering how much!
The good news is, it finally seems like other languages are starting to tool out the way Erlang has (Akka, ZMQ, etc).
A benchmark of anything but the best library/tools in each language is pointless.
It wraps an existing TCP factory, and makes it work with WebSocket.
The entire API is a single function.
Regardless, using a single library, and not even the mainstream one, makes for a poor benchmark.
Micro-benchmarks rarely are complex enough to expose design problems, my point was that one should at least use the de-facto standard, if not several alternatives too.
https://github.com/williame/hellepoll
http://williamedwardscoder.tumblr.com/post/18200335569/the-h...
http://williamedwardscoder.tumblr.com/post/13590981677/perfo...
If this is correct, then it's no big surprise that he does well in his own benchmark that he's developing against.
[1]: https://github.com/ericmoritz/wsdemo/blob/master/src/wsdemo.... [2]: https://github.com/extend/cowboy
What I mean is, I'd expect a first run of 5 mins to warm up the servers, than another one to actually get the data.
Otherwise, while averages will be mostly the same, numbers like the dropped connections _could_ be misleading.