Skyline

Laravel queues in production

13 posts · Updated · Boring Observability

Dispatching a Laravel job is one line. Most of what goes wrong happens after it, between a worker reserving the job and the job being deleted, and it tends to surface only once there is enough traffic for two workers to touch the same thing.

These posts follow a job through that gap. The life of a queued job has the whole state machine in one place. The others each take one setting or feature (retry_after, ShouldBeUnique, backoff, chains, Horizon's balancing) and show what it does when the assumptions behind it stop holding.

For changes to the queue in the framework itself, the Laravel queue changelog lists every queue-related commit since Laravel 13.0.

· 13 min read

What Happens When You Clear a Queue in Laravel?

Clearing a Laravel queue deletes the payloads but not the ShouldBeUnique locks they hold, and with the default uniqueFor those locks never expire. How to see what is in a backlog, what queue:clear deletes, and how to drain it without leaving a job that can't be dispatched again.

Read more

· 15 min read

Laravel ShouldBeUnique: What Breaks Under Real Traffic

ShouldBeUnique and WithoutOverlapping solve different problems and fail in different ways. What each one locks and when, and the failures that show up only at volume: dispatches dropped without an error, chains and retries that skip the lock, and locks that never expire.

Read more