Monday, June 18, 2012

Erlang Concurrency Model FTW?

While catching up on my reading list, I came across this performance benchmark of C10k web servers.
ImplementationConnection Time (mean)Latency (mean)MessagesConnectionsConnection Timeouts
Erlang (Cowboy)865ms17ms2849294100000
Haskell (Snap)168ms227ms11874134996108
Java (Webbit)567ms835ms10283904637157
Node.js (websocket)768ms42580ms117084757014299
Python (ws4py)1561ms34889ms105299647925208
With the exception of Connection Time, Cowboy totally owns other web servers' asses in all other categories.

In the realm of high concurrency and availability, Erlang still rules supreme.

There are a couple of observations that I want to make:
  1. Despite all the hype, Node.js still fails to deliver. Don't get me wrong, I really like the idea of running JavaScript on the server. Most web developers already know JavaScript and can't be bothered to pick up a functional language just to write asynchronous and event-driven software, so the barrier to entry is significantly reduced. I just wish that all the attention and community participation would have resulted in something better in terms of scalability and performance.
  2. Although Cowboy's average Connection Time is second worst and eight times Snap's average, practically speaking most users won't even notice the difference as the former still takes less than a second. When it comes to performance, perceived responsiveness matters more than raw numbers. There's a big difference between comparing 100ms to 800ms and 1s to 8s.

No comments: