Running a web server on node.js is a simple matter (as can be seen from its excellent examples and documentation), but I wonder how you can fully utilize the processor resources of a dedicated server?
Since node.js is single-threaded, the only way to take advantage of multiple processors is through multiple processes. Of course, only one process can bind to the port, so it seems that there should be a master / worker template in which the wizard expands the children, binds to the incoming port and delegates incoming connections (and actual processing) to the children, (Perhaps, through the hungry consumer pattern ?)
Is this the best way to scale a web server with node.js? If so, are there libraries to simplify the master / worker template? If not, which deployment templates or installations are recommended for the best use of all the resources of a dedicated machine?
(Is this the best question for ServerFault ?)
maerics
source share