[NOWJS] Max updates per second?

88 views
Skip to first unread message

Ponko

unread,
Jun 18, 2011, 8:19:29 PM6/18/11
to nowjs
Hi all.

I am curious - how many updates per second I can pump from server to
clients via Websockets? 10/sec? 1000/sec? What are the limits of NowJS
and Socket.io?

Thanks in advance.

Sridatta Thatipamala

unread,
Jun 18, 2011, 9:44:35 PM6/18/11
to no...@googlegroups.com
I've tested it to max out at ~1000 messages/second.

Tom

unread,
Jun 19, 2011, 5:23:49 AM6/19/11
to no...@googlegroups.com

What happend at that stage? Since socket.io does not allow you to force a limit, my prediction is that the underlying tcp transport will buffer request resulting in a memory leak.

Tom

Ponko

unread,
Jun 19, 2011, 6:43:38 AM6/19/11
to nowjs
Another question: How many concurrent connections can NowJS/Socket.io
handle? Or maby we are limited to node.js limits?

Thanks.

Tom

unread,
Jun 19, 2011, 6:52:01 AM6/19/11
to no...@googlegroups.com
Now that I come to think of it, the 1000 limit Sridatta saw is probably because of the default file descriptors limit, you should try to run such test again with increased limits.

And to Ponko, that obviously depends on the hardware, so there is no uniform answer.

Tom

2011/6/19 Ponko <pmat...@gmail.com>

Sridatta Thatipamala

unread,
Jun 19, 2011, 7:03:10 AM6/19/11
to no...@googlegroups.com
Tom: No, it wasn't that the file descriptors were set at the default
1024. I had far fewer clients. The test was as follows:
10% of the clients would send messages to the server every second, and
each message would be broadcast back to all the clients.
I ramped up to various numbers and found the maximum sustainable
number was when I had 100 clients ( = 10 inbound messages/second * 100
outbound messages/ inbound message = 1000 outbound messages per
second).

Of course, the latency was pretty bad but the server could still keep
up with the load. I can get some specific latency numbers if you guys
want.

I tried this with both NowJS and with barebones socket.io with similar
results. The only difference is that NowJS adds a bit of latency (in
the single-digit milliseconds). This implies to me that the bottleneck
lies in socket.io itself or somewhere lower in the stack (like the TCP
buffer, as Tom suspects).

Tom

unread,
Jun 19, 2011, 7:29:14 AM6/19/11
to no...@googlegroups.com
Thanks Sridatta.

I do not suspect that the buffer is the cause though, it is simply the result of the bottleneck. The bottleneck is probably your hardware (it should be, otherwise there are more real issues).

What is more important to me, is what happens when you reach that bottleneck: are buffers filled? Did you inspect your RAM usage?

In any way, I hope socket.io will provide low level access so that we can force limits so that such dangerous levels will be avoided by simply not accepting more connections (and enable some alert mechanic for the administrator, so that he can deal with malicious usage or upgrade the server cluster in case there is a legit increase in traffic).

Tom

2011/6/19 Sridatta Thatipamala <srid...@nowjs.com>
Reply all
Reply to author
Forward
0 new messages