UPD. The second version of the benchmark here:
eric.themoritzfamily.com/websocket-demo-results-v2.html
Warning : if you have complaints about the benchmark and / or code, the benchmark
is laid out on GitHub , which allows you to correct bugs or report bugs to the author.
Read more about the problem of 10,000 connections:
ru.wikipedia.org/wiki/Problema_10000_ connections
How to solve the problem of 10,000 connections through web socketstack Erlang, Go, Haskell (Snap), Java (Webbit), Node.js (websocket) and Python (ws4py)?
')
During the benchmark, a new client is launched every millisecond. Once a second, each client sends a message with the current time to the server, and the server sends this message back.
Implementation | Connection time (average) | Delay (average) | Posts | Compounds | Connection timeouts |
---|
Erlang | 865ms | 17ms | 2849294 | 10,000 | 0 |
Haskell (Snap) | 168ms | 227ms | 1187413 | 4996 | 108 |
Java (Webbit) | 567ms | 835ms | 1028390 | 4637 | 157 |
Go | 284ms | 18503ms | 2398180 | 9775 | 225 |
Node.js (websocket) | 768ms | 42580ms | 1170847 | 5701 | 4299 |
Python (ws4py) | 1561ms | 34889ms | 1052996 | 4792 | 5208 |
Implementations on Python and Node.js fell on about half of the connections.
Despite the fact that Go was expected to tear Erlang in performance, the delay was much higher and the server did not process the request on 225 connections.
Java Webbit was a dark horse, but ultimately showed better results than Go (157 raw connections).
The most amazing thing is that gevent (Python) and node.js stopped working after 5001 and 4792 connections respectively, despite the fact that both were implemented specifically to solve the C10k problem.
A more detailed description, code and raw data is available on GitHub:
github.com/ericmoritz/wsdemo/blob/master/results.mdUPD. Comparisons include more and more people; tests for Tornado (Python) have appeared
UPD. The second version of the benchmark here:
eric.themoritzfamily.com/websocket-demo-results-v2.html