Skip to content

yunke-yunfly/yunfly-plugin-memory-check

Repository files navigation

@yunflyjs/yunfly-plugin-memory-check

Yunfly memory check plugin. If a certain threshold is exceeded, kill node service.

Usage

  1. install
yarn add @yunflyjs/yunfly-plugin-memory-check
  1. declare plugins in config/config.plugin.ts
/**
 * yunfly plugin
 */
const plugins: {[key:string]: string}[] = [
  {
    name: 'memoryCheck',
    package: '@yunflyjs/yunfly-plugin-memory-check',
    lifeHook: 'beforeStart'
  }
];
// 
export default plugins;
  1. enable plugins in config/config.default.ts
config.memoryCheck = {
  enable: true,
  triggerThreshold: 0.9, // memory usage rate 90%
  intervalTime: 300000, // 5 minute
  cron: '*/20 * * * * *',
}

About

Yunfly memory check plugin. If a certain threshold is exceeded, kill node service.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published