Skip to content
No description or website provided.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app
bin
lib
README.md
package.json

README.md

cluster-manager

A module for Node.js that manages a cluster.

Install

npm install cluster-manager

Usage

var cm = require('cluster-manager');
var options = {
  app: './app' // path to app a worker serves
};
var master = cm.run(options);
if(master) {
  // we're in the master-process
}

See ./app/index.js for a minimum app-file.

Master Interface

array .getPIDs()
worker .fork([cb])
.stop(pid)
.restart(pid)
.restartAll()
.restartZDT(pid)
.restartAllZDT()

Features

  • Forks one worker per CPU by default (can be raised or lowered)
  • Reload of workers with a zero-down-time option
  • Commandline tool available

More features will be added by request.

Something went wrong with that request. Please try again.