|
|
@ -1,13 +1,10 @@ |
|
|
|
|
|
|
|
const numCpus = require('os').cpus().length; |
|
|
|
module.exports = { |
|
|
|
module.exports = { |
|
|
|
// Options reference: https://pm2.io/doc/en/runtime/reference/ecosystem-file/
|
|
|
|
// Options reference: https://pm2.io/doc/en/runtime/reference/ecosystem-file/
|
|
|
|
apps : [{ |
|
|
|
apps : [{ |
|
|
|
name: 'build-worker', |
|
|
|
name: 'build-worker', |
|
|
|
script: 'worker.js', |
|
|
|
script: 'worker.js', |
|
|
|
instances: 2, |
|
|
|
instances: Math.floor(numCpus/2), //if you only have 1 core and floor to 0, 0 just means "all cores" which is correct in that case.
|
|
|
|
/* |
|
|
|
|
|
|
|
increase instances if building is getting backed up, |
|
|
|
|
|
|
|
best to keep at numCPUs-1 to prevent server choke under high load though. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
autorestart: true, |
|
|
|
autorestart: true, |
|
|
|
watch: false, |
|
|
|
watch: false, |
|
|
|
max_memory_restart: '1G', |
|
|
|
max_memory_restart: '1G', |
|
|
@ -24,7 +21,7 @@ module.exports = { |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
name: 'chan', |
|
|
|
name: 'chan', |
|
|
|
script: 'server.js', |
|
|
|
script: 'server.js', |
|
|
|
instances: 0, // 0 = number of cpu cores
|
|
|
|
instances: Math.floor(numCpus/2), |
|
|
|
autorestart: true, |
|
|
|
autorestart: true, |
|
|
|
watch: false, |
|
|
|
watch: false, |
|
|
|
max_memory_restart: '1G', |
|
|
|
max_memory_restart: '1G', |
|
|
|