@heroku/worker-monitor
a node worker process monitor
Last updated 6 years ago by heroku .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @heroku/worker-monitor 
SYNC missed versions from official npm registry.

worker-monitor

A module for monitoring the memory usage of Node worker processes, and killing them when they reach a specified limit. This module is designed to be used in conjunction with clusterflock.

Usage

Simply require and call worker-monitor for it to begin monitoring worker processes:

if (require('cluster').isWorker) {
  require('worker-monitor')();
}

Options

The worker-monitor function accepts a few options:

  • disconnectTimeout (Default: 5000) The time after which a disconnecting worker will be immediately killed if it has failed to disconnect.
  • logPeriod (Default: 10000) The frequency with with a worker's memory usage will be logged.
  • monitorPeriod (Default: 5000) The frequency with with a worker's memory is monitored. This is when the worker will be killed if it exceeds memoryLimit.
  • memoryLimit (Default: 220000000) The limit (in bytes) that a worker's RSS may be.

For example:

require('worker-monitor')({
  disconnectTimeout: 10000,
  logPeriod        : 5000
});

Thanks, Heroku

While I created and maintain this project, it was done while I was an employee of Heroku on the Human Interfaces Team, and they were kind enough to allow me to open source the work. Heroku is awesome.

Current Tags

  • 1.0.0                                ...           latest (6 years ago)

1 Versions

  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |