Answer the question
In order to leave comments, you need to log in
Max number of socket.io connections on nodejs?
The question has already been asked, but has not received a clear answer.
How many simultaneous connections can be on one server?
As far as I understand, the 65K limit is not a limit for the server, but the maximum number of connections from one client to one server port . If so, then it turns out that the maximum number is 65K * 65K = 4225000000?
Help me to understand.
Answer the question
In order to leave comments, you need to log in
then the maximum number on IPv4 is 2^32 * 2^16 = 281474976710656 (in fact, not all addresses can be used), even if 16Kb will go to one user (buffers, structures, pointers, etc.) then this is 4 398 046 511 104 Mb memory :) It will end first.
Estimate how much memory you want for sockets, and divide by 16Kb (from your head, you can measure it yourself for a node).
If you disable TCP keep-alive and WS ping, then the sockets are passive and do not eat the CPU.
Sockets do not limit you in the number of simultaneous connections. It only limits the hardware on which the server is installed.
Given the fact that socket.io also works without web sockets using the polling mechanism (it falls back to it when it is impossible to use web sockets), the number of sessions can be infinite, because. the client can send a ton of packets for different sessions from the same client port.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question