Reputation: 12503
I have a beanstalkd queue implementation. I have created a benchmark tool to test the time of my queue processing. When I open my PHP worker in a terminal tab like this:
php artisan queue:work --daemon --sleep=0
It takes around 8 seconds to finish all my jobs. If I open total 4 terminal tabs and run the above line then test again with same load, it takes around 2 seconds. Which is great.
However when I run my workers using supervisord
it takes around 7-8 seconds to process the same load, with 4 workers. Even if I increase my workers to 20, I don't see any impact. Sometimes I see increasing worker has a negative impact (11 seconds). I am sure all 20 workers are running.
So what's the issue here? How can I speed up my processing? In a real server I can't keep workers running in terminal tabs. I will highly appreciate your help :)
Here's my supervisor config:
[program:app-worker]
process_name=%(program_name)s_%(process_num)02d
command=php artisan queue:work --daemon --sleep=0
directory=/home/vagrant/Code/app
autostart=true
autorestart=true
user=vagrant
redirect_stderr=true
numprocs=4
stdout_logfile=/home/vagrant/Code/app/storage/logs/worker.log
Upvotes: 1
Views: 2469
Reputation: 6726
Even though this ticket is 2 years old, I think it's worth an answer.
My guess is this would have been caused by the explicit log file you're setting and the redirection of stderr, in addition, based on your config, looks like you're running this locally, and in a non-isolated environment, meaning your host OS operations and apps would be interfering with your benchmarks.
Either way, I'm sure you've solved this long ago :D
Upvotes: 1