Insights / Laravel
Laravel queues in production: what we monitor, and why.
Failed jobs aren't the problem — silent ones are. The metrics, alerts and Horizon settings we put on every Laravel project before launch.
[Author] · [Role] · 8 min read
queue:work
On this page
01 · Watch the wait
02 · Split by urgency
03 · Safe to run twice
04 · Alert on silence
The checklist
02 · Split by urgency
03 · Safe to run twice
04 · Alert on silence
The checklist
Every Laravel app we ship runs queued work: emails, webhooks, exports, image processing. Queues are also where failures go to hide — a job that never runs doesn't throw an exception in front of anyone. This is the checklist we put in place before launch.
01 Watch the wait, not just the failures
The failed_jobs table tells you what broke. It doesn't tell you a queue is quietly backing up. We alert on wait time per queue, so someone hears about it before a customer does.
02 Split queues by urgency
One queue means a ten-minute export can block a password-reset email. We split work into at least critical, default and long — each with its own workers, timeouts and retry policy.
A queue that's quietly forty minutes behind is an outage your dashboard doesn't show.
03 Make every job safe to run twice
Workers die, deploys restart them, retries happen. Jobs have to be idempotent: check state before acting, give them a unique ID, and back off between attempts instead of hammering a failing API.
04 Alert on silence
A scheduled command that stops running produces no errors at all. Every scheduled task pings a heartbeat monitor when it finishes, and we alert when the ping doesn't arrive.
The checklist
+ Wait-time alerts per queue, not just failure alerts
+ Separate critical, default and long-running queues
+ Idempotent jobs with unique IDs and backoff
+ Heartbeat pings on every scheduled command
+ Separate critical, default and long-running queues
+ Idempotent jobs with unique IDs and backoff
+ Heartbeat pings on every scheduled command
[Author name] — [Role], xDevLabs. One-line author bio.
Keep reading.
All insightsLaravel
Five MySQL index checks before you scale
Laravel
Upgrading Laravel without stopping feature work
DevOps