Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages

Help for owners

Emails, uploads and other background tasks are piling up and not finishing

Short answer

Apps hand slow work such as emails, imports and image processing to a background queue and a worker that runs it. When the worker stops, crashes or is too slow, jobs pile up. Do not restart servers or clear the queue yourself, since that can delete jobs. Tell your developer what is waiting and since when.

  • Written for business owners
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Does this sound like your situation?

  • Emails, notifications or receipts arrive hours late or never.
  • Uploaded files stay in processing.
  • Reports and exports never finish.
  • It started after an update, a deploy or a server move.
  • My developer says the queue is backed up.

Why does this happen?

  1. The worker process stopped

    Queue workers are long-running programs. Laravel's documentation says a worker that exits is typically restarted by a process manager configured on the server. Without one, a single crash or reboot leaves the queue unprocessed.

  2. Workers keep running old code after an update

    A long-running worker loads the app once. After a deploy it can keep running the old version, or fail on jobs that were created by the new one, until it is restarted on purpose.

  3. A job fails and is retried or given up

    A job that keeps failing is attempted again up to its limit and then marked failed. Laravel's documentation notes that a job exceeding its maximum attempts is considered failed. If the limit is set to retry forever, one bad job can keep the line busy.

  4. The queue service itself is down or full

    The queue lives in a database or in a service like Redis. If it is out of memory or unreachable, jobs cannot be added or fetched.

  5. Too much work for too few workers

    A busy period, a big import or a slow outside service can add jobs faster than they finish, so the line only grows.

What can I do about it today?

  1. Write down what is waitingNote what kind of work is delayed, how many items you know of and when it last worked normally.
  2. Do not clear or purge the queueClearing it deletes customer emails, orders and uploads for good. Only a developer who has checked what is in it should touch it.
  3. Do not resubmit the same itemsUploading again or resending creates duplicates when the original jobs finally run.
  4. Ask whether a deploy or server change happenedA recent update or reboot is the most common starting point. Send the date to your developer.
  5. Tell customers about the delayA short message that emails or processing are delayed prevents repeat requests.

When should I bring someone in?

  • The delayed jobs include payments, orders or confirmations.
  • The pile keeps growing after a restart.
  • Nobody knows how the queue is run on the server.

How do I handle it?

  1. Look before touchingI check whether the worker is alive, what is in the queue and what the failed jobs say, without deleting anything.
  2. Find why work stopped or slowedA crashed worker, old code, a failing job type or a full queue service: the logs show which.
  3. Restore processing and drain safelyI fix the cause, start workers under a process manager, and let the backlog drain at a pace the system can take, retrying failed jobs only when it is safe.
  4. Prevent a repeatWorkers restart themselves, deploys restart them on purpose, and an alert fires when the queue grows or a worker is missing.

The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.

What do owners ask about this?

Are the waiting jobs lost?

Usually not. They sit in the queue until a worker takes them, which is why clearing the queue is the one thing to avoid.

Why did the problem show up only now?

A stopped worker can go unnoticed until the delayed work is something visible, like an email a customer expected.

Is this about tasks that run on a schedule?

No, that is a separate problem, described on the scheduled tasks page. A queue holds work that was triggered by a user action.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.

For your developer: the technical fixes

Next step

Want this off your desk?

Send me a few lines on where things stand. I reply within 24 hours.