Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node.js server with socket.io handling 50000 simultaneous clients

We are developing a Javascript control which should be constantly connected to a server for receiving animation updates.

We are planning to host this stuff on an Amazon cloud.

The scenario is like this: server connects to activemq queue waiting for updates, for each update it broadcasts it to all connected clients.

Is it even possible to handle such load with node.js + socket.io? Will a single node.js server be able to handle such load? How to organize fast transport between different nodes if we will have to use more than one node?

like image 294
v00d00 Avatar asked Feb 19 '13 08:02

v00d00


People also ask

How many simultaneous connections can Socket.IO handle?

Once you reboot your machine, you will now be able to happily go to 55k concurrent connections (per incoming IP).

How many simultaneous connections can node js handle?

JS uses a single thread with an event-loop. In this way, Node can handle 1000s of concurrent connections without any of the traditional detriments associated with threads.

How many Socket connections can a Node server handle?

The theoretical limit is 65k connections per IP address but the actual limit is often more like 20k, so we use multiple addresses to connect 20k to each (50 * 20k = 1 mil).

How many requests per second can a Node server handle?

However, considering that a “Hello World” Node. js server is easily capable of thirty thousand requests per second on that machine that produced these results, 23 requests per second with an average latency exceeding 3 seconds is dismal.


1 Answers

Will single node.js server be able to handle such load?.. How to organize fast transport between different nodes if we will have to use more than one node

You say that you are planning to host on Amazon. So first off, nothing should be scoped for a single server. Amazon machines will simply "disappear", you have to assume that you are going to use multiple computers.

...handling 50k simultaneous clients

So to start with, 50k connections for a single box is a very big number. Here's a very detailed blog post discussing "getting to 10k" with node.js+socket.io.

Here's a very telling quote:

it seemed as though 10,000 clients simply required more serialization than my server was able to handle.

So a key component to "getting to 50k" is going to be the amount of work required just pushing data over the wire.

How to organize fast transport between different nodes if we will have to use more than one node.

That blog post is the first of 3. When you're done the first, read the other two. That should point you in the right direction.

like image 87
Gates VP Avatar answered Oct 20 '22 03:10

Gates VP