cluster.fork() is built on top of child_process.fork() but adds load balancing, shared port binding, and cluster-specific lifecycle management. child_process.fork() is a general-purpose tool for spawning child processes without these networking features.
Both methods create new Node.js child processes with IPC channels, but they serve different purposes. cluster.fork() is specifically designed for building HTTP servers that can share a port and distribute load. child_process.fork() is a lower-level API used for offloading CPU-intensive tasks or running isolated scripts.
Workers share the same server port automatically
Built-in round-robin load balancing by the master
Cluster events: fork, online, listening, exit, disconnect
Workers are tracked in the cluster.workers map
Designed specifically for HTTP server scaling
General-purpose child process creation
No shared port or built-in load balancing
Full IPC channel for message passing
Used for CPU-bound task offloading to a separate script
Spawns an entirely separate Node.js script file