@yunflyjs/yunfly-plugin-memory-check
v0.0.1
Published
Yunfly memory check plugin. If a certain threshold is exceeded, kill node service.
Downloads
2
Maintainers
Readme
@yunflyjs/yunfly-plugin-memory-check
Yunfly memory check plugin. If a certain threshold is exceeded, kill node service.
Usage
- install
yarn add @yunflyjs/yunfly-plugin-memory-check
- 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;
- enable plugins in config/config.default.ts
config.memoryCheck = {
enable: true,
triggerThreshold: 0.9, // memory usage rate 90%
intervalTime: 300000, // 5 minute
cron: '*/20 * * * * *',
}