Jobs
Offload long-running and compute-intensive worker tasks, and schedule cron scripts to run at specific times.
Jobs is an optional component that can be booked and scaled per environment in the dashboard. The scaling increases in available RAM and number of jobs.
┌─────────┐ ┌───────────────────┐ ┌─────────────┐ │ visitor │ ◀─ Request/response ─▶ │ environment │ ◀──▶ │ worker/cron │ └─────────┘ └───────────────────┘ └─────────────┘raw
Jobs run in a separate runtime container with access to the environment's file system and database. They are deferred from the front-end web layer to a background process that operates outside the web request/response life-cycle. This ensures that web requests are delivered swiftly, even when heavy processing is happening in the background. Environment variables and settings are kept in sync.
# Job types
Worker jobs and cron jobs are widely supported by modern PHP frameworks like Laravel and Symfony, as well as CMS systems like Craft CMS and Statamic.
# Scaling
The available job plans differ in available memory and the number of jobs, that can be booked. Use the dashboard metrics to understand usage to determine the right plan to choose. Experiment with different plans to find the optimal scaling the project requires.
# Performance
Beside scaling up the component to improve performance, consider code refactoring or adjusting usage patterns.
# Sign of bad performance
- Overlapping jobs not finishing in decent time
- Increased 503 or 504 errors are