Search code examples
ruby-on-railsperformanceresqueworker

How to ensure in Rails that Resque queues works each on in a different job?


I've seen some documentation about resque, and all the tips tell to run the queues with this command:

rake resque:work QUEUE='*'

What is this command really doing? Is it running all the queues in just one job?

I didn't find documentation talking about how to run the queues one by one. But, is there any performance difference considering that I will run all of them in the same server?


Solution

  • Next command

    rake resque:work QUEUE='*'
    

    creates a single process that includes all your queues, so definitely, it won't have a good performance. If you have multiples queues, it will work as if they were sequential.

    If you want to have each queue running in a different process, you should execute your queues one by one:

    rake resque:work QUEUE=queue_one &
    rake resque:work QUEUE=queue_two &
    rake resque:work QUEUE=queue_three &