添加配置
server.js
// server.js
const egg = require('egg');
const workers = Number(process.argv[2] || require('os').cpus().length);
egg.startCluster({
workers,
baseDir: __dirname,
});
pm2启动
pm2 start server.js
添加配置
server.js
// server.js
const egg = require('egg');
const workers = Number(process.argv[2] || require('os').cpus().length);
egg.startCluster({
workers,
baseDir: __dirname,
});
pm2启动
pm2 start server.js
本文标题:egg 用pm2管理
本文链接:https://www.haomeiwen.com/subject/uuwirctx.html
网友评论