blog-client/ecosystem.config.js

17 lines
530 B
JavaScript
Raw Normal View History

2021-08-04 16:48:25 +08:00
module.exports = {
apps: [{
name: 'blog-client',
2021-08-04 17:01:23 +08:00
script: './server/index.js',
2021-08-04 16:48:25 +08:00
watch: false,
max_memory_restart: '3G', // 超过多大内存自动重启,仅防止内存泄露有意义,需要根据自己的业务设置
env: {
NODE_ENV: 'production',
HOST: '0.0.0.0',
2021-08-04 17:01:23 +08:00
PORT: 8080
2021-08-04 16:48:25 +08:00
},
exec_mode: 'cluster', // 开启多线程模式,用于负载均衡
instances: 'max', // 启用多少个实例,可用于负载均衡
autorestart: true // 程序崩溃后自动重启
}]
2021-08-04 16:49:01 +08:00
}