- type
- concept
- created
- Tue Apr 07 2026 02:00:00 GMT+0200 (Central European Summer Time)
- updated
- Tue Apr 07 2026 02:00:00 GMT+0200 (Central European Summer Time)
- sources
- raw/notes/techContext
- tags
- pm2 process-management gunicorn celery redis infrastructure
PM2 Process Layout
abstract
The platform runs three PM2-managed processes: marketplace-api (gunicorn on port 8910), celery-worker (async task processing), and celery-beat (periodic task scheduling).Overview
wiki/entities/b2bpaper uses PM2 as its process manager on the Contabo VPS. PM2 handles process startup, restart on crash, log management, and monitoring. All backend processes are managed through PM2 rather than systemd or Docker.
Managed Processes
marketplace-api
- What it runs: Gunicorn serving the Django application
- Port: 8910 (bound to
127.0.0.1) - Proxied by: Nginx at
https://b2bpaper.xdvu.com/mvp/(see wiki/concepts/nginx-mvp-routing) - Role: Serves all HTTP requests -- API endpoints, admin interface, static files (via Nginx)
celery-worker
- What it runs: Celery worker process consuming tasks from Redis
- Role: Executes async tasks including:
- Email ingestion (parsing incoming mill emails)
- Matching algorithm execution
- Newsletter generation and sending
- Container assembly calculations
- Broker: Redis (local)
celery-beat
- What it runs: Celery Beat scheduler
- Role: Triggers periodic tasks on a schedule:
- Weekly newsletter generation
- Exclusivity window expiry checks
- Data cleanup and maintenance tasks
- Broker: Redis (local)
Infrastructure Dependencies
PM2
├── marketplace-api (gunicorn) → port 8910 → Nginx → public
├── celery-worker → Redis → task execution
└── celery-beat → Redis → scheduled triggers
↓
PostgreSQL (db: b2bpaper)
All three processes depend on:
- PostgreSQL -- the
b2bpaperdatabase (credentials inbackend/.env) - Redis -- message broker for Celery task queue
Management Commands
Common PM2 operations:
pm2 status-- check all process statusespm2 restart marketplace-api-- restart the Django serverpm2 logs marketplace-api-- view recent logspm2 restart all-- restart everything
Key Rules
- Never run
python manage.py runserverin production -- always use PM2-managed gunicorn - Never run
ng serve-- the frontend is built and served as static files - Always check PM2 status after deployment changes
- 12-factor app -- all configuration via environment variables in
backend/.env
Sources
- raw/notes/techContext -- PM2 process name, port configuration, and infrastructure details
Related
- wiki/concepts/nginx-mvp-routing -- how Nginx proxies to marketplace-api
- wiki/concepts/deployment-urls -- the public URLs that map to these processes
- wiki/concepts/django-app-layout -- the Django app that marketplace-api serves
- wiki/concepts/eight-core-actions -- the actions that celery-worker executes
- wiki/entities/b2bpaper -- the platform these processes power