Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/printercu/cluster_master
Simple and powerful cluster manager
https://github.com/printercu/cluster_master
Last synced: 27 days ago
JSON representation
Simple and powerful cluster manager
- Host: GitHub
- URL: https://github.com/printercu/cluster_master
- Owner: printercu
- Created: 2013-07-16T17:14:37.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-09-03T15:54:12.000Z (about 11 years ago)
- Last Synced: 2024-10-03T04:32:26.961Z (about 1 month ago)
- Language: CoffeeScript
- Homepage:
- Size: 105 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ClusterMaster
Basic cluster management in one line:
```coffee
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 workersFor 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](https://github.com/nodejitsu/forever)```sh
forever start -c coffee server.coffee
```it can be reloaded with
```sh
forever stop --killSignal SIGHUP -c coffee server.coffee
```## License
MIT