# clustered-node

> A simple library to create/migrate/manage multi-process clustered environment in nodejs

Latest version **0.0.9** (published 2015-03-10) · 0 weekly downloads

## Install

```sh
npm install clustered-node
pnpm add clustered-node
yarn add clustered-node
bun add clustered-node
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2015-03-10 |
| First published | 2014-10-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Rana |
| Maintainers | ranacseruet |
| Keywords | cluster, worker, multi-process, multi-thread, failure tolerance |

## Links

- npm: https://www.npmjs.com/package/clustered-node
- Repository: git@github.com:ranacseruet/clustered-node
- Homepage: https://github.com/ranacseruet/clustered-node
- Issues: https://github.com/ranacseruet/clustered-node/issues
- npm.io page: https://npm.io/package/clustered-node

## Dependencies (1)

- [winston](https://npm.io/package/winston.md) *

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 0.0.9 (latest) — 2015-03-10
- 0.0.8 — 2015-01-09
- 0.0.7 — 2015-01-05
- 0.0.5 — 2014-10-28
- 0.0.4 — 2014-10-22
- 0.0.3 — 2014-10-22
- 0.0.2 — 2014-10-19
- 0.0.1 — 2014-10-19

## README

clustered-node
==============
[![Build Status](https://travis-ci.org/ranacseruet/clustered-node.svg)](https://travis-ci.org/ranacseruet/clustered-node)

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](https://github.com/kriszyp/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](https://github.com/hipache/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.

---
_Source: https://npm.io/package/clustered-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
