October cms Background Queues

Hy,

Does the latest version of October CMS support then new queue connection “Background Queues”?

Thanks

Hi @ridha82,

What are you refering to? Queues concept from Laravel are supported. Setting QUEUE_CONNECTION=database in .env / config will make them run in background

Hi @apinard

In Laravel, the onConnection('background') method, particularly relevant since Laravel 12.37, allows you to dispatch a job to a specific background queue connection. This is a minimalist approach for deferring jobs to execute in the background without requiring a separate, dedicated queue worker process.

Laravel 12.37 introduced a “background” queue driver. This driver leverages Concurrently::defer() to execute jobs in a separate PHP process.

Hi @ridha82,

Interesting ! Queues - Laravel 12.x - The PHP Framework For Web Artisans

Are you using OctoberCMS V4? Looks like this feature was introduced in V12.

If so, you should be able to:

  1. Add the ‘background’ config to your config/queue.php inside the connections array.
  2. Or dispatch on the fly: Job::dispatch()->onConnection(‘background’);
  3. Or set public $connection = ‘background’; inside the job class.

(Below a resume from Gemini3, if that can help)


A Warning on “Background” vs “Database” Queues

It might be tempting to use background for everything to avoid setting up Supervisor, but there is a major risk regarding server load.

Think of it like a Pizza Shop:

  • The background Driver:
    100 orders come in at the exact same second. You immediately hire 100 temporary chefs to cook them all at once.

    • Result: The customers get served fast, but 100 people in a small kitchen causes chaos, and the building might burn down (Server Crash / Fork Bomb ).
  • The database Driver (Standard Queue):
    100 orders come in. You have 2 full-time chefs (your Queue Workers). They put the orders on a ticket rail and cook them 2 at a time.

    • Result: It takes longer to clear the backlog, but the kitchen runs smoothly and never crashes (Stable Server ).

Quick Comparison

Driver Execution User Waits? Risk / Downside Best Use Case
Sync Immediate Yes Slows down the user experience. Critical data (e.g., creating a User ID).
Deferred Post-Response No Occupies a PHP-FPM slot. Can cause “Server Busy” errors for new users. Light cleanup tasks (logging, 1 API call).
Background New Process No High CPU/RAM usage. Spawns a process per job. Risk of crashing under high traffic. Medium tasks on low-traffic sites (e.g., Admin internal tools).
Database Worker Process No Requires supervisor setup. Heavy lifting (Video, Bulk Email). Essential for high traffic.