Allow excluding sidekiq queues from execution in sidekiq-cluster
Extracted from https://gitlab.com/gitlab-com/infrastructure/issues/2197#note_34595436.
We currently allow you to run extra sidekiq processes using bin/sidekiq-cluster
.
In addition to the existing arguments where a set of queues can be specified, we want an argument that can negate those, so all queues except the specified ones are picked up. That way if you run one command with queue1,queue2
and another with --negate queue1,queue2
(or whatever), you can guarantee that all queues are being picked up. We can do this by parsing sidekiq_queues.yml
and then applying the operation there.
The production team are currently doing the following for this dashboard: https://performance.gitlab.net/dashboard/db/sidekiq-stats
-
best-effort
runs everything (regular sidekiq CLI) -
asap
runs only a certain set of queues -
real-time
runs only a certain set of queues
Once we add this option, we can change that to:
-
best-effort
runs--negate $asap_queues,$real_time_queues
(Note that to create multiple Sidekiq processes running the same sets of queues, the arguments can just be repeated: $real_time_queues $real_time_queues $real_time_queues
will create three processes.)