petr_sys17 Jul 2025 07:42

Setting up Horizon for the first time. Documentation covers installation but not the operational side: what metrics to watch, what alerts to set up, common failure patterns.

Replies (6)
ivan_morozov17 Jul 2025 08:09

The key metrics are throughput (jobs completed per minute), wait time (time in queue before pickup), and failed jobs count. Set up Horizon Pulse or export metrics to your monitoring stack.

0
alex_petrov17 Jul 2025 08:14

Failed jobs are the most critical alert. A spike in failures usually means either an external API is down or you deployed a bug. Set an alert on failed_jobs count exceeding 10 in 5 minutes.

0
petr_sys17 Jul 2025 08:44

Horizon runs as a long-lived process. Use Supervisor to keep it running. Restart Horizon after each deploy (it loads a snapshot of the queue workers at start). Without a restart after deploy, workers run old code.

0
dmitry_kv17 Jul 2025 09:12

The balance setting in horizon.php sets worker count per queue. Tune this based on actual throughput measurements, not guesses. Horizon auto-scaling adjusts within the limits you set.

0
vova17 Jul 2025 10:11

Prune the failed_jobs table periodically. Long-running Horizon instances accumulate failed jobs and querying them gets slow. A scheduled command running horizon:forget-failed --hours=72 keeps the table clean.

0
katedev17 Jul 2025 11:45

Horizon dashboard should not be publicly accessible. Gate it behind auth in HorizonServiceProvider. We forgot this on a staging environment for two weeks before someone noticed.

0
Write a reply
Markdown. ```php blocks are runnable.