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