-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecosystem.config.js
More file actions
53 lines (51 loc) · 1.66 KB
/
Copy pathecosystem.config.js
File metadata and controls
53 lines (51 loc) · 1.66 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* PM2 Ecosystem Configuration for BizBot
*
* Usage:
* pm2 start ecosystem.config.js
* pm2 logs bizbot
* pm2 restart bizbot
* pm2 stop bizbot
* pm2 startup # Enable auto-start on system boot
* pm2 save # Save current process list
*/
export const apps = [
{
name: 'bizbot',
script: './start-bizbot.sh',
interpreter: 'bash',
cwd: '/opt/bizbot', // Update this to your actual deployment path
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'production'
},
error_file: './logs/pm2-error.log',
out_file: './logs/pm2-out.log',
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
merge_logs: true,
// Restart delay
restart_delay: 4000,
// Exponential backoff restart delay
exp_backoff_restart_delay: 100,
// Maximum number of restarts within a minute before stopping
max_restarts: 10,
min_uptime: '10s',
// Process cleanup settings - aggressive to prevent zombie processes
kill_timeout: 3000, // Wait only 3 seconds before force killing
wait_ready: false, // Don't wait for ready signal
listen_timeout: 8000, // Timeout for app to bind to port
// Force single instance
exec_mode: 'fork',
// Shutdown settings
shutdown_with_message: false,
// Force kill any lingering processes
force: true,
// Disable auto-restart during shutdown
autorestart: true,
// Use SIGKILL instead of SIGTERM for more aggressive killing
kill_retry_time: 100
}
];