Docs cipi.yml Web panel API MCP Guides Compare GitHub Telegram channel
  1. Docs
  2. Apps
  3. Queues & Horizon

Queues & Horizon

Supervisor workers and Laravel Horizon per app.

Apps

Every Laravel app starts with one Supervisor worker on the default queue. Add queues, scale processes, or hand everything to Horizon.

Queue workers
$ cipi worker add shop --queue=emails --processes=2
$ cipi worker list shop
bash
cipi worker add myapp --queue=emails --processes=3
cipi worker add myapp --queue=exports --processes=1 --timeout=7200
cipi worker edit myapp --queue=default --processes=3
cipi worker list myapp
cipi worker remove myapp emails
cipi worker restart myapp
FlagMeaningDefault
--queueQueue to consumedefault
--processesParallel processes1
--triesAttempts before failed_jobs3
--timeoutSeconds a process lives before it's recycled (--max-time), and how long a stop waits for the running job3600

Plain workers consume the database connection; Redis (Valkey) queues run under Horizon. A single job's time limit is its own $timeout property (Laravel's default is 60 seconds).

Horizon#

bash
cipi worker horizon enable myapp
cipi worker horizon status myapp
cipi worker horizon disable myapp

Horizon replaces the queue:work workers of that app (one or the other, not both). It needs the queues on Redis: set QUEUE_CONNECTION=redis with cipi app env; each app has its own Valkey instance ready.

When a deploy finds laravel/horizon installed, it helps without overriding your choices:

The deploy findsIt does
Horizon, queues on Redis, no workerEnables Horizon
Horizon plus existing workersExplains how to switch; changes nothing
Horizon, queues not on RedisTells you which variable to set

A Horizon you disabled stays disabled. cipi pending lists apps with Horizon installed but nothing processing jobs.

During deploys#

Step 1 of 3Stop workers

Before the new release goes live, workers stop. Each finishes the job it's running (up to its --timeout).

Workers never run old code against a new database. Supervisor restarts a worker only after an unexpected exit. Workers can also be declared in cipi.yml.

As the app user#

App users manage their own workers without root, through a narrow helper:

bash
sudo cipi-worker status myapp
sudo cipi-worker restart myapp

Common problems#

ProblemFix
Jobs never runNo worker on that queue, or QUEUE_CONNECTION=redis without Horizon
Job killed after 60 sSet public $timeout on the job and raise retry_after
Workers run old codecipi worker restart myapp (deploys do it automatically)

Questions#

QuestionAnswer
Workers or Horizon?Workers for a few queues on the database; Horizon for Redis queues with a dashboard. Guide.
How many processes?Start with 1–2 per queue and watch wait times.
Do workers survive a reboot?Yes, Supervisor starts them at boot.