Skip to content

Instantly share code, notes, and snippets.

@akumbhani66
Created September 25, 2020 05:54
Show Gist options
  • Save akumbhani66/75a86c97fbf9e419495351923e275768 to your computer and use it in GitHub Desktop.
Save akumbhani66/75a86c97fbf9e419495351923e275768 to your computer and use it in GitHub Desktop.
sample pm2 ecosystem config
module.exports = {
apps: [
{
name: 'node-server',
script: './bin/www',
error_file: './logs/err.log',
out_file: './logs/out.log',
time: true,
log_date_format: 'YYYY-MM-DD HH:mm Z',
watch: false,
kill_timeout: 30000, // At least 30s for connections to close
wait_ready: true, // Wait for ready signal before accepting requests
instances: 'max', // Max: Cluster on all CPU cores
exec_mode: 'cluster',
},
{
name: 'test-server',
script: './bin/www',
watch: false,
kill_timeout: 30000, // At least 30s for connections to close
wait_ready: true, // Wait for ready signal before accepting requests
instances: 3, // Max: Cluster on all CPU cores
exec_mode: 'cluster',
// node_args: '--trace-warnings',
},
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment