Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maximum concurrently open rooms in socket.io

I am in the process of implementing a chat server using node.js, mongodb, socket.io and express. What I would like to know is whether there's a limit on the maximum no. of concurrently open rooms for socket.io multi-room chat.

Also, is there a maximum on no. of users per room.

like image 619
user1583920 Avatar asked Sep 03 '12 10:09

user1583920


People also ask

How many rooms can Socket.IO handle?

socket.io rooms are a lightweight data structure. They are simply an array of connections that are associated with that room. You can have as many as you want (within normal memory usage limits). There is no heavyweight thing that makes a room expensive in terms of resources.

How many simultaneous connections can Socket.IO handle?

As we saw in the performance section of this article, a Socket.IO server can sustain 10,000 concurrent connections.

Is Socket.IO multithreaded?

While not comparable to eventlet and gevent in terms of performance, the Socket.IO server can also be configured to work with multi-threaded web servers that use standard Python threads. This is an ideal setup to use with development servers such as Werkzeug.

How many Socket connections can Nodejs 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).


1 Answers

Socket.io has no restrictions and limitations for how many users can be connected to the server, how many users in a room or how many rooms there is.

Your limitations are related to:

  1. Software implementation (performance)
  2. Networking logic model: evented, threaded, single-threaded
  3. OS setup: socket handlers and many other specifics
  4. Hardware: CPU, RAM, Bandwidth (In\Out), HDD/SSD (if there is database/file cache (still can be RAM based)).

Order is important and usually try to approach from the top to the bottom, reevaluating each point in advance based on requirements of your application. OS Setup have to be completed initially.

like image 106
moka Avatar answered Nov 14 '22 21:11

moka