Queue priority and workers per queue?

Tags: #<Tag:0x00007f64b616cc00>


Can anyone explain in better detail how queues work? The documentation is pretty light on the inner-workings of it.

If I have one server with three queues and 20 workers, how are those 20 workers divided up if there were a hundred jobs ready to run in each of the three queues?

I’ve seen some people mention queue priority being alphabetical or something of that sort but it isn’t clear how that works.

If I have queues of “thirdParty”, “framework”, and “background”, are they automatically assigned priority given where they are in my array of queues? If a job tries to fire in each queue, does the first listed queue always win the race?

One other question:
If I want my workers to be evenly split/available to each queue, how can I do that instead of a first-come-first-serve pool?


We generally don’t use multiple queues per BackgroundJobServer so I don’t have answer as to how work is pulled off queues.

For your second question, you can have multiple BackgroundJobServers running per process, each with an individual queue & worker count. So you could set up one BackgroundJobServer per queue with 7 workers. Hard to recommend a configuration without knowing what problem you’re trying to solve by utilizing multiple queues.