LearnBoost Cluster Manager

0.7.7 · abandoned · verified Sun Apr 19

This `cluster` package, developed by LearnBoost, is an extensible multi-core server manager for Node.js applications, last released as version 0.7.7. It was created to provide advanced process management features such as zero-downtime restarts, graceful shutdowns, worker resuscitation, and configurable worker counts (defaulting to CPU cores), during a period when the native Node.js `cluster` module was either unavailable or less feature-rich (specifically, between Node.js v0.4 and v0.8). The library offers a robust plugin system, including built-in plugins for command-line interfaces, debugging, logging, PID file management, automatic reloads, and REPL-based administration. Despite its innovative features for its time, the project is considered abandoned, with the last substantial development activity over a decade ago and official support for only very old Node.js versions (0.2.x, 0.4.x). It does not function with contemporary Node.js runtimes, making it a historical artifact rather than a viable solution for modern applications.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize the LearnBoost Cluster manager with an HTTP server and enable several of its bundled plugins for logging, statistics, PID file management, CLI, and REPL. It shows the typical CJS `require` pattern for setting up a multi-process Node.js application, with one master process managing multiple worker processes.

const http = require('http');
const cluster = require('cluster');

// app.js (or inline server definition)
const app = http.createServer(function(req, res){
  console.log('Worker %s handling request for %s %s', process.pid, req.method, req.url);
  const body = 'Hello World from worker ' + process.pid;
  res.writeHead(200, { 'Content-Length': Buffer.byteLength(body) });
  res.end(body);
});

// server.js (main cluster entry point)
if (require.main === module) {
  cluster(app)
    .use(cluster.logger('logs')) // Example plugin: logs master/worker activity
    .use(cluster.stats())     // Example plugin: adds real-time statistics
    .use(cluster.pidfiles('pids')) // Example plugin: writes master/worker pidfiles
    .use(cluster.cli())       // Example plugin: provides a command-line interface
    .use(cluster.repl(8888))  // Example plugin: real-time administration via REPL
    .listen(3000, function(){
      console.log('Cluster listening on port 3000, with %d workers', cluster.workers.length);
    });
  console.log('Master process %s started.', process.pid);
} else {
  // When required by the master, just export the app
  module.exports = app;
}

view raw JSON →