Skip to content

feat: Add PM2 ecosystem configuration for production process management - #382

Merged
zeemscript merged 1 commit into
Deen-Bridge:mainfrom
believetimothy:add-pm2-ecosystem
Aug 30, 2026
Merged

feat: Add PM2 ecosystem configuration for production process management#382
zeemscript merged 1 commit into
Deen-Bridge:mainfrom
believetimothy:add-pm2-ecosystem

Conversation

@believetimothy

Copy link
Copy Markdown
Contributor

Summary

Adds a PM2 ecosystem configuration file (ecosystem.config.js) for production process management, enabling cluster mode, auto-restart, memory-based restart, and log rotation.

Changes

  • ecosystem.config.js — New PM2 ecosystem configuration with:
    • Cluster mode (exec_mode: "cluster", instances: "max") for multi-core utilization
    • Auto-restart on crash with configurable restart delay (4s) and max restarts (16)
    • Max-memory-restart at 1G threshold to prevent memory leaks
    • Log management with merged logs, timestamps, and pm2-logrotate module instructions (50MB rotation, 10 retained files, daily rotation, gzip compression)
    • Environment configuration for production (NODE_ENV, PORT)
    • Zero-downtime deployments via pm2 reload

Usage

# Start in production
pm2 start ecosystem.config.js --env production

# Reload all cluster instances with zero downtime
pm2 reload ecosystem.config.js --update-env

# Install log rotation module
pm2 install pm2-logrotate
pm2 set pm2-logrotate:max_size 50M
pm2 set pm2-logrotate:retain 10
pm2 set pm2-logrotate:compress true
pm2 set pm2-logrotate:rotateInterval '0 0 * * *'

Closes

Add PM2 ecosystem.config.js with cluster mode enabled for multi-core
utilization, auto-restart on crash, max-memory-restart at 1G threshold,
and log rotation settings via pm2-logrotate module. This enables
zero-downtime deployments with `pm2 reload` and ensures process
resiliency in production environments.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@believetimothy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bd5da4e6-01f5-466d-a015-d01266824e68


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zeemscript
zeemscript merged commit 19e74df into Deen-Bridge:main Aug 30, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(admin): Add admin dashboard API endpoints infra: Implement distributed tracing (Jaeger/Zipkin) infra: Add PM2 ecosystem config

2 participants