How many concurrent connections can socket.io handle?

2,940 views
Skip to first unread message

Ponko

unread,
May 21, 2011, 12:35:55 PM5/21/11
to Socket.IO
Hi there.

I am preparing a small node.js app that will tell me how many users
are on my website at the moment. I will use socket.io:

var socket = io.listen(app);
socket.on('connection', function(client){
++userCount;
client.on('message', function(data){ });
client.on('disconnect', function(){
--userCount;
});
});

What if I have a website with LOADS of traffic. Will socket.io and
node.js handle so many concurent connections (i.e 1.000.000 at the
same time)? I am curious if socket.io will bring my node.js server
down...

Arnout Kazemier

unread,
May 25, 2011, 11:04:53 AM5/25/11
to sock...@googlegroups.com
No it will not handle 1M connections as it runs on a single process which are limited to about 1.7gb RSS in heap size, so you would need to scale across multiple process if you want to handle that.
Node will most like crash out of memory if you receive that much load without a scalable solution.

( I calculated the theoretical node.js real time limits: http://blog.3rd-eden.com/post/5809079469/theoretical-node-js-real-time-performance )

Reply all
Reply to author
Forward
0 new messages