0

I'm using Laravel 5.5 with the database queue driver to manage jobs, and I have 5 workers running. However, I've noticed that the rate at which jobs are processed remains constant at 100 jobs per minute, regardless of the number of workers.

When I tested locally, I found that the workers are processing jobs sequentially. A worker only starts processing a new job once the current one is finished, which eliminates the advantage of having multiple workers.

Previously, I encountered a similar issue when jobs in a custom queue were being processed sequentially. Switching back to the default queue resolved the problem, allowing jobs to be processed in parallel. However, even with all jobs in the default queue now, they are still being processed sequentially.

ENV File

QUEUE_DRIVER = database

Supervisord

[program:laravel_queue]
process_name=%(program_name)s_%(process_num)02d
command=php artisan queue:work --delay=10 --tries=10 --timeout=300
directory=/var/www/html
stdout_logfile=/var/www/html/storage/logs/laravel-queue.log
logfile_maxbytes=0
logfile_backups=0
redirect_stderr=true
autostart=true
numprocs=5
autorestart=true
startretries=86400
6
  • 1
    why are you still using laravel 5? Commented Dec 18, 2024 at 9:43
  • @ArifulIslam Existing project specifications. So do you have any suggestions Commented Dec 18, 2024 at 9:57
  • Maybe you're facing a bug in Laravel 5? Keep in mind that v5.5 is EOL since over four years, and I don't want to check how many security issues are unfixed in your application Commented Dec 18, 2024 at 10:25
  • can you try copying over the same job class in a newer Laravel version? Commented Dec 18, 2024 at 10:33
  • Try installing redis and use that as a queue driver there may be limitations on concurrency on the database driver Commented Dec 18, 2024 at 10:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.