clustered-node
A simple library to create/migrate/manage multi-process clustered environment in nodejs
Last updated 5 years ago by ranacseruet .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install clustered-node 
SYNC missed versions from official npm registry.

clustered-node

Build Status

A Simple library to make your traditional single threaded nodejs server into a multi-process based server, so that you can make better utilization of your server cpu.

This project is inspired by multi-node project, which isn't anymore compatible with latest nodejs version.

Also a large portion of this project implementation idea is taken from hipache project's multi-process architecture.

Features

  • Maximum Utilization of multi-core/multi-cpu environment by parallel processing of requests.
  • Enforce app to be in scalable architecture.
  • Failure tolerance. Automatically restart a process if crashed for some reason, no need for external monitoring system.

Install

npm install clustered-node

Usage

var http    = require("http");
var clustered_node = require("clustered-node");

var server = http.createServer(function(req, res){
     res.end("Hello World");
});

function runServer() {
    return http.createServer(function(req, res){
        res.end("Hello World");
    });
};

clustered_node.listen({port:1337, workers:3}, server);
//or
clustered_node.run(config, runServer);

Development and Testing

npm install
npm test
grunt

Future Consideration

  • More API method to lessen developer effort in creating http server
  • Feature to auto restart a process after certain number of requests, to facilitate bypassing memory leak issues, even if there any.
  • More unit test cases.

Contribute

Please report any bugs/feature requests via github issue tracking. Pull requests are very much welcome as well.

Current Tags

  • 0.0.9                                ...           latest (5 years ago)

8 Versions

  • 0.0.9                                ...           5 years ago
  • 0.0.8                                ...           5 years ago
  • 0.0.7                                ...           5 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |