To make the most of Node.js performance on servers with multiple processors, you need to be able to farm off work to the other processes. The process
module allows you to interact with the system process, the child_process
module allows you to actually execute code on a separate process, and the cluster
module allows you to create a cluster of HTTP or TCP servers.
child_process
provides the exec()
, execFile()
, spawn()
, and fork()
functions, which start work on separate processes. The ChildProcess
and Worker
objects provide IPC channels that allow you to communicate between the parent and child processes.