1
votes

I have multiple queue workers on my Laravel 5.2 project. I am running on AWS. I am using ECS. I am using Redis for my queue driver.

I would like to know..

If I have 2 servers working the same queue

php /var/www/laravel/artisan queue:listen --env=production --timeout=30 --tries=1 --queue=mail

Will they both process the job, thus it gets processed twice? Or will it only get processed once and this will help with the load/redundancy?

Many Thanks in advance!

1

1 Answers

4
votes

A job only exists on a queue once, as soon as a worker grabs the job, it is removed from the queue.

So as long as the different workers are accessing the same instance of the same queue, the jobs will only be executed once.