Nodejs - Why can Node.js handle a large number of concurrent persistent connections?

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?

+5
source share
2 answers

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 (*). , - , - , , .

A node.js, , , , , .

*) MPM , .

+6

, , - (, apache ..) , HTTP-. = > , , , , - . , , : , ( , , , ), , . , , -

Javascript, , ( ) = > , , , . - .

, .

0

All Articles