New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

cluster_master

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cluster_master

Easy cluster management + zero downtime deploys & reloads

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

ClusterMaster

Basic cluster management in one line:

return if require('cluster_master').runMaster()
# worker's code here

By default it'll spawn os.cpus().length workers and respawn every dead worker.

Out of box you'll get safe zero downtime reload:

  • send SIGHUP to process
  • cluster will try to spawn new worker
  • if new worker is ok then cluster will gracefully close one running worker & 'll reload all old workers
  • if new forker failed it won't destroy old workers

For more stuff see source.

Use forever

Oops! Seems like forever still does not have proper support for specifying kill signal.

However you can specify pid file for ClusterMaster and send hups yourself:

return if require('cluster_master').runMaster(pidfile: 'pids/cluster.pid')

May be later: Once cluster is started with forever

forever start -c coffee server.coffee

it can be reloaded with

forever stop --killSignal SIGHUP -c coffee server.coffee

License

MIT

Keywords

deploy

FAQs

Package last updated on 03 Sep 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts