Frappe Processes
A running Frappe environment depends on both system-level services and Frappe-specific processes. Together, these components handle database operations, request processing, background jobs, caching, scheduling, and overall application management.
Overview
System services are managed by the operating system or deployment tools, while Frappe processes are defined within the framework and can be started manually or managed through process managers such as Supervisor.
System Processes
These services provide the underlying infrastructure required for a Frappe application to operate correctly. Depending on your deployment architecture, Bench may automatically generate their configuration.
| Service | Purpose |
|---|---|
| MariaDB / PostgreSQL | Stores application data, user information, documents, and configuration. |
| Redis | Provides caching and manages background job queues for improved performance. |
| NGINX | Acts as a reverse proxy for production deployments, routing incoming HTTP requests to the application. |
| Supervisor | Monitors and automatically manages Frappe processes in non-containerized production environments. |
Frappe Processes
Frappe defines several application processes that handle web requests, background tasks, and scheduled jobs. These processes can be started manually or managed automatically by Supervisor in production deployments.
1. WSGI Server
The WSGI server receives HTTP requests from users and serves the Frappe application.
- During development,
bench serveorbench startlaunches the Werkzeug development server. - In production, Bench automatically configures
Gunicornas the WSGI server through Supervisor.
2. Redis Worker Processes
Worker processes execute background jobs asynchronously, preventing long-running tasks from slowing down user requests.
- Automatically started when
bench startis executed. - Managed through Supervisor in production environments.
- Processes queued tasks such as emails, reports, integrations, and scheduled jobs.
3. Scheduler Process
The Scheduler is responsible for triggering scheduled events and placing recurring jobs into the worker queues for execution.
- Automatically starts with
bench start. - Configured through Supervisor in production deployments.
- Ensures scheduled tasks run at their configured intervals.
For development benches, these processes are defined in the Procfile. In production deployments, Bench generates the required supervisor.conf configuration to manage them automatically.
Best Practice
Keep all required system services and Frappe processes running at all times. Missing services such as Redis, the database, or worker processes can lead to failed background jobs, slow performance, or application downtime.