Cookies ahead

Our support chat tool "Intercom" would like to collect some more data on you. See the related link for more details.

Docs

Craft CMS queue jobs

Reviewedbyfl

Markdown ↓

How to run Craft CMS queue jobs in the background without blocking your application's PHP processes.

Craft CMS uses queue jobs for long-running tasks. By default, these jobs are processed by a web-based AJAX call that blocks PHP processes meant for site delivery. In the worst case, the queue runner consumes all available PHP resources. Better solutions are available.

The most common use case is image transformations.

Worker jobs

Run long-running processes in an isolated environment without affecting site delivery. The jobs component allows you to create a worker job to run in the background.

  1. Make sure the jobs component is booked
  2. Set up a job with this Craft command: php craft queue/listen --verbose
  3. Set runQueueAutomatically to false in config/general.php to disable the default queue processing

Alternatives

A lighter alternative is the Async Queue plugin. For many queue workloads, the ostark/craft-async-queue plugin can mitigate performance problems without needing an extra component or additional configuration.

Written by a human. Review, grammar checks and typo fixes by AI.

AI use & editorial processEdit on GitHub ↗