GithubHelp home page GithubHelp logo

clu's Introduction

clu

UNMAINTAINED โ€“ But turns out this module still works with node 6

A cluster manager with a built in CLI and a simple API for plugins. clu will spawn the requested number of workers, which will share the same port. This way the load gets distributed across all workers and multiple cores can be used effectively. It uses the node cluster API to do this.

Inspired by cluster.

Features:

  • built in CLI (optional)
  • zero downtime restarts
  • restarts workers one after another
  • add or remove workers on the fly
  • uses the node cluster API

Build Status Dependency Status

Getting Started

  1. npm install --save clu

  2. Create a server.js that starts your app.

    var clu = require('clu');
    
    clu.createCluster({
      exec: './app.js',
      workers: 2,
      silent: false,
      silentWorkers: true,
      cli: true
    });
    // short: clu.createCluster('./app.js');
    
    clu.use(clu.repl());
  3. Start your cluster with node server start

Use node server --help for a list of all commands.

You can also start the server with node server. This will start the server in the foreground.

Documentation

Plugins

Plugins can be used like this:

var cluDnode = require('clu-dnode');
clu.use(cluDnode());
clu.use(clu.repl('myRepl.sock'));

Built in:

  • clu.repl() - a repl interface

Official:

3rd Party: contact me if you create any :)

License

MIT

clu's People

Contributors

fiws avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

clu's Issues

`node server stop` doesn't stop processes

Hi there, trying to use clu, but it seems node server stop doesn't stop the processes. It does remove the .sock files in .clu, but the processes themselves never end, and .clu/pids/master.pid is never removed either.
(Speaking of which, should .clu/pids contain a file for each process? since that's NOT the case)

Some context: using clu v0.3.8 on Mac OS X v10.10.3 with node v0.12.4

//file: server.js
var clu = require( "clu" );

clu.createCluster( {
  exec: "./app.js",
  workers: 1,
  silent: false,
  silentWorkers: false,
  cli: true
} );
// short: clu.createCluster("./app.js");

clu.use( clu.repl() );

started with node server. node server restart works perfectly, only node server stop doesn't seem to do anything.

Is there anything I'm missing here in regards of configuration or something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.