Node.js on multi-core machines

前端 未结 15 1591
猫巷女王i
猫巷女王i 2020-11-22 07:46

Node.js looks interesting, BUT I must miss something - isn\'t Node.js tuned only to run on a single process and thread?

Then how does it scale for m

15条回答
  •  猫巷女王i
    2020-11-22 08:16

    It's also possible to design the web-service as several stand alone servers that listen to unix sockets, so that you can push functions like data processing into seperate processes.

    This is similar to most scrpting/database web server architectures where a cgi process handles business logic and then pushes and pulls the data via a unix socket to a database.

    the difference being that the data processing is written as a node webserver listening on a port.

    it's more complex but ultimately its where multi-core development has to go. a multiprocess architecture using multiple components for each web request.

提交回复
热议问题