Imagine dispatching a large batch, one that has thousands of jobs: Bus::batch($jobs)->dispatch(); During the dispatching process, Laravel creates a record inside the job_batches database table and then acquires a lock on that row while the jobs are being dispatched to the queue. Workers might pick some of those jobs up before the full batch finishes dispatching. And after processing any of those jobs, the workers will try to update the database row for the batch. But that row will be locked by the process that's still dispatching more jobs.

In addition, you may configure a delay on the batch jobs so workers won't pick them up too fast.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners