
SocketCluster – WebSockets that scale to 100K messages per second on 8 cores - BukhariH
https://github.com/topcloud/socketcluster
======
alecsmart1
From their readme-

"The test was only set to reach up to 100 concurrent connections (each sending
1000 messages per second) - Total of 100K messages per second."

So they had only 100 concurrent connections.

~~~
denizozger
Number of connections, message size, and frequency of messages sent are three
main parameters to measure performance, and for some frameworks like
Engine.IO, number of connections seems to have the biggest impact on
performance ([https://medium.com/node-js-
javascript/b63bfca0539](https://medium.com/node-js-javascript/b63bfca0539)).
It would be good to see the benchmarks with much higher number of connections,
as non-blocking IO is usually why people choose Node.js platform.

------
teacup50
Is 100K mps on _8 cores_ considered high for node/websockets microbenchmarking
of the socket path?

That doesn't seem like much from past experience writing high-throughput
messaging code, and all this is doing is spitting out length-framed messages
to a socket.

~~~
limsup
Can you give some numbers of your past experience?

~~~
brianwawok
Not OP, but a solar flare can shoot 20 million packets per second..

[http://www.solarflare.com/09-11-12-Solarflares-Industry-
Lead...](http://www.solarflare.com/09-11-12-Solarflares-Industry-Leading-
Highest-Performance-Adapter-Now-Available-in-Dell-Mezzanine-Form-Factor)

You need to totally bypass the linux kernel to do this, and have high perf C
or Java code...

~~~
chmod775
That's raw network (TCP/UDP) packets, not WebSocket frames/messages. Plus that
product is a solution to a hardware problem, not a software problem. It
doesn't relate at all.

------
lacksconfidence
This is interesting, how does it compare to using nginx(or another proxy) in
front of multiple socket.io instances on the same machine?

~~~
jonpress
I wrote SocketCluster. I haven't tried that yet, it would definitely be
interesting to test.

~~~
tracker1
I'd be interested in seeing how difficult it would be to modify this to use
multiple communication servers (redis, cassandra, etc) so that it can be
scaled across multiple instances.

Would also be interested in seeing how many connections it could handle doing
say 5-10 messages per second.

------
johtso
There's also sockjs ([http://sockjs.org](http://sockjs.org)) which has some
rather impressive benchmark results when using the python/tornado server with
PyPy ([http://mrjoes.github.io/2011/12/15/sockjs-
bench.html](http://mrjoes.github.io/2011/12/15/sockjs-bench.html)).
155,000-195,000 messages per second on a single core.

------
Rauchg
It'd be nice to compare it with: [https://github.com/automattic/socket.io-
redis](https://github.com/automattic/socket.io-redis)

I wrote an example application using it here:
[https://github.com/guille/weplay](https://github.com/guille/weplay)

~~~
alecsmart1
How many simultaneous connections are you able to achieve?

------
denizozger
Why does each worker need a seperate store process? It seems on an 8 core
machine max worker count can only be 3 (1 master, 3 workers, 3 stores). If
workers had in-memory stores -or at least connect to a Redis server-, with 4
more workers performance should increase.

~~~
knodi
node is single threaded

~~~
denizozger
I'm aware, and what's the relevance? I didn't even mention threads.

~~~
AYBABTME
You can't use more than 1 core with a unique node process. So they spawn n
cores for n processes. With a multithreaded runtime, this would not be
required.

~~~
denizozger
Yes exactly. My suggestion was the application to fork (CPUs - 1) workers, ie.
1 master 7 workers, instead of 1 master 3 workers and 3 stores, and have
workers manage their key-value stores. Apparently each worker don't need a
store, see author's comment
([https://news.ycombinator.com/item?id=7713561](https://news.ycombinator.com/item?id=7713561))
so it looks good.

------
trungonnews
Do you think Golang can handle more connections than NodeJS?

