-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpm2.json
29 lines (29 loc) · 1023 Bytes
/
pm2.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
"apps": [{
// Application #1
"name": "server",
"script": "server/app.js",
// 启用多少个实例,可用于负载均衡。如果-i 0或者-i max,则根据当前机器核数确定实例数目
"instances": 0,
"exec_mode": "cluster",
// 如果想要你的应用,在超过使用内存上限后自动重启,那么可以加上--max-memory-restart参数
"max_memory_restart": "1G",
"autorestart": true,
"merge_logs": true,
"error_file": "logs/child-err.log",
"out_file": "logs/child-out.log",
"pid_file": "logs/child.pid"
}, {
// Application #2
"name": "jserver",
"script": "server/jserver/jserver.js",
"instances": 0,
"exec_mode": "cluster",
"max_memory_restart": "1G",
"autorestart": true,
"merge_logs": true,
"error_file": "logs/child-err.log",
"out_file": "logs/child-out.log",
"pid_file": "logs/child.pid"
}]
}