worker process
One of the processes forked by a cluster's primary to handle requests, each with its own memory and event loop.
In more detail
If one crashes, the others keep serving and the primary can start a replacement. Workers cannot share memory directly; they communicate with the primary over IPC.
Related terms
- cluster module — The Node.js module that starts several copies of a server as worker processes sharing one port, so a machine's CPU cores can all serve requests.
- primary process — The first process in a Node.js cluster, which starts and replaces worker processes and distributes connections to them.
- worker.disconnect() — The cluster method that tells a worker to stop accepting new connections, finish its current ones and then exit.
Taught in
- Cluster Architecture: node:cluster & Zero-Downtime — Node.js Internals & Backend Services