I know that Node.js is good at keeping a large number of simultaneous constant connections, for example, in a chat room for many conversations.
I wonder how this is achieved. I mean, in any case, it uses TCP / IP, which is encapsulated by the underlying OS, why can it handle persistent connections so well that others cannot?
What is this magic thing?
Node.js does all asynchronous I / O. It works in only one thread, but will perform other requests or operations while waiting for I / O.
, - , . Apache ; , 10 httpd , , 10 (*). , - , - , , .
httpd
A node.js, , , , , .
*) MPM , .
, , - (, apache ..) , HTTP-. = > , , , , - . , , : , ( , , , ), , . , , -
Javascript, , ( ) = > , , , . - .
, .