Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
JavaScript
Branch: master
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.