Skip to content

A single instance of Node.js runs in a single thread. To take advantage of multi-core systems, the user will sometimes want to launch a cluster of Node.js processes to handle the load.

License

Notifications You must be signed in to change notification settings

BrsJsk/use-max-cpu

Repository files navigation

use-max-cpu NPM version Build Status Dependency Status Coverage percentage

A single instance of Node.js runs in a single thread. To take advantage of multi-core systems, the user will sometimes want to launch a cluster of Node.js processes to handle the load.

Installation

$ npm install --save use-max-cpu

Usage

const {startServer} = require('use-max-cpu');
const http = require('http');

startServer(() => {
    console.log('Worker started..')
    http.createServer((req, res) => {
        res.writeHead(200);
        res.end('hello world\n');
      }).listen(8000);
})

License

MIT © Boris Joskic

About

A single instance of Node.js runs in a single thread. To take advantage of multi-core systems, the user will sometimes want to launch a cluster of Node.js processes to handle the load.

Resources

License

Stars

Watchers

Forks

Packages

No packages published