Skip to content
Test c10m on a single host.
Branch: master
Clone or download
Latest commit 9486214 Nov 20, 2014
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Nov 19, 2014
LICENSE Initial commit Nov 19, 2014 . Nov 20, 2014 Added config file. Nov 20, 2014 Added config file. Nov 20, 2014 Added config file. Nov 20, 2014 Added config file. Nov 20, 2014 Added config file. Nov 20, 2014


Simple echo server & client that supports TCP / WebSocket. Using Tornado. Supposed to run on one host.


Many articles about setting up C10M (10,000,000 concurrent connections) server out there, and you can find out code samples, usually supporting WebSocket. This sample code is backed by Tornado and supports TCP / WebSocket.

Basically, server in this code is just an echo server, but there is some workaround for C10M.

How to run

Do tuning host for C10M: It varies which OS you're using. Just google "C10M performance tuning {your os name}," then you got tons of articles.

Install Tornado.

pip install tornado

Open two terminals, run in one.

(fp)Kenials-MacBook-Pro:tornado-test-c10m kenial$ python
[W 141119 02:56:13 server:62]
[W 141119 02:56:13 server:63] Server: Test C1M on Tornado (Press Q to quit)
[W 141119 02:56:13 server:64] ---------------------------------------------
[W 141119 02:56:13 server:46] 0 TCP conns, 0.00 reqs/s, 0 bytes/s
[W 141119 02:56:13 server:47] 0 WS conns, 0.00 reqs/s, 0 bytes/s

Run or in other one.

(fp)Kenials-MacBook-Pro:tornado-test-c10m kenial$ python
[W 141119 02:56:54 tcp_client:153] TCP Client: Test C1M on Tornado
[W 141119 02:56:54 tcp_client:154] -------------------------------
[W 141119 02:56:54 tcp_client:155]
[W 141119 02:56:54 tcp_client:72] Concurrent conns: 0
[W 141119 02:56:54 tcp_client:73] (C)reate TCP connections
[W 141119 02:56:54 tcp_client:74] (S)end messages to opened connections
[W 141119 02:56:54 tcp_client:75] Create TCP connections and send (B)ulk messages
[W 141119 02:56:54 tcp_client:76] (R)emove All connections
[W 141119 02:56:54 tcp_client:77] (Q)uit
[W 141119 02:57:04 tcp_client:83] How many connections:
[W 141119 02:57:07 tcp_client:142] elapsed: 0.013293

Working notes

(If you're a Korean, read this:

You can’t perform that action at this time.