Node.js module

cluster

The 'node:cluster' module provides a way to create a small network of processes to share server ports and distribute workload across CPU cores. It uses the fork() mechanism to spawn worker processes that share the same server handles.

Clustered applications can handle more concurrent connections by distributing requests among workers. The module includes utilities for worker management, messaging, and graceful shutdown.

Works in Bun · notes

Implemented but not battle-tested. Handles and file descriptors cannot be passed between workers, limiting TCP server load-balancing across processes to Linux (via SO_REUSEPORT).