Answer the question
In order to leave comments, you need to log in
How to make multiple task queues in Laravel?
Hello.
Created a task queue in Laravel. Driver - database. There is only one queue. ( https://laravel.com/docs/5.5/queues)
How to make multiple queues at the same time? For example, 5?
Works via Supervisor, current config is
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php artisan queue:listen --queue=high,default --sleep=1 --tries=3 - -timeout=0
autostart=true
autorestart=true
user=forge
numprocs=8
redirect_stderr=true
The queue works like this. But there are many tasks, they are long. are done slowly and some users have to wait several hours, and their task takes a couple of minutes.
I did numprocs=8 and priority --queue=high,default but nothing changed.
I used the commands: sudo service supervisord restart and supervisorctl restart
to update the config file but no change. I'm thinking maybe I'm updating the file incorrectly? And when I update it for real, will everything work for me? :)
because numprocs=8, then there should be 8 parallel executions of tasks ? Or am I misunderstanding?
UPD: I checked. With the help of the sudo service supervisord restart command, the config file was still updated. those. it is relevant, however, there is only one process, despite the fact that numprocs=8 is set.
Back to the problem, how to configure so that several tasks are executed in parallel in the task queue (and not sequentially) ?
Answer the question
In order to leave comments, you need to log in
because numprocs=8, then there should be 8 parallel executions of tasks ?Yes.
Once the configuration file has been created, you may update the Supervisor configuration and start the processes using the following commands:https://laravel.com/docs/5.5/queues#supervisor-con...sudo supervisorctl reread sudo supervisorctl update sudo supervisorctl start laravel-worker:*
For more information on Supervisor, consult the Supervisor documentation .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question