Skip to content

oleics/cluster-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published