📜 ⬆️ ⬇️

C10k (Problem 10,000 connections) in different languages ​​/ platforms



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.

ImplementationConnection time (average)Delay (average)PostsCompoundsConnection timeouts
Erlang865ms17ms284929410,0000
Haskell (Snap)168ms227ms11874134996108
Java (Webbit)567ms835ms10283904637157
Go284ms18503ms23981809775225
Node.js (websocket)768ms42580ms117084757014299
Python (ws4py)1561ms34889ms105299647925208


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.md

UPD. 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

Source: https://habr.com/ru/post/145796/


All Articles