cpu-cluster
Turn a server into a CPU bound cluster.
features:
- create one child process per CPU core
- share network ports
- auto respawn when a child process dies
- expose
cluster
object for low level event handlers
Installation
$ npm install cpu-cluster
Usage
const cpuCluster = const http = const cluster = cluster
API
cpu-cluster(opts?, server)
Create a cluster where each server
is started as a separate process. Takes
the following options:
- n: amount of child process to start. Defaults to the number of CPU cores available on the machine.
- timeout: timeout after a child process exits and a new process is
started. Defaults to
100
ms.