600K concurrent HTTP connections with Clojure and http-kit
http-kit.org
http-kit.org
> {:dependencies [[org.clojure/clojure "1.5.1"]]}
netty is in the dev dependencies, but for benchmarking only I would guess.
[edit] This project is one of the best thing that happened in the web area in clojure recently imho. Not only it is a game changer in performance/resource use, but it makes websocket and async in general trivial to use and actually production ready (same goes for its client). Some would mention Pedestal but it forces you to learn quite a few abstractions and is totally alien compared to the rest of the clojure web ecosystem and also only supports a single async "protocol" (SSE). But pedestal is about a full stack experience, integration with the client etc, so it certainly will attract other users.
edit upon review, not a huge diff between the two actually.
http://blog.whatsapp.com/index.php/2011/09/one-million/
HN discussion for the above link. https://news.ycombinator.com/item?id=3028547
Node.JS solve this problem by doing all in Asynchronous way (in only one thread). GO solve this pb by doing clever threads (goroutine). Functional programming seems to be very good on this issue (no need of lock mecanism and light thread).
Edit: It looks like the test was run only on localhost, which also means that it artificially removes much of the processing and actual network I/O factors from the equation.
| Clojure | WhatsApp
---------------------------
CPU | i7-2600 | Xeon X5675
Clock| 3.4GHz | 3.07GHz
Cores| 4 | 24
RAM | 16G | 96G
Conns| 600,000 | 2,000,000
It seems pretty clear that the performance increase is line with the better hardware specs.There is one very significant difference and that is that the Clojure benchmark was just a benchmark while for WhatsApp it was their actual system doing something real. They have mentioned to me that they have managed to push their system to 3M connections but not in production.
Wouldn't it be better if clients are running on different machine(s)?
[edit]
https://github.com/http-kit/http-kit/blob/master/src/org/htt...
https://github.com/http-kit/scale-clojure-web-app/blob/maste...
It wouldn't hurt to actually emphasize "600,000" by explicitly expressing all of the zeroes.