Project 'gitlab-com/gl-infra/scalability' was moved to 'gitlab-com/gl-infra/observability/team'. Please update any links and bookmarks that may still have the old path.
Make self-managed instances use routing rules by default
After we resolve the workers that depend on their queue sizes, it's safe to migrate self-managed instances from queue selector to routing rules. From a long discussion in #1281 (closed), it turns out the best solution is the simplest solution. We agree that we will simply use [["*", "default"]] routing rules for self-managed instances. This configuration is good enough for most use cases.
Changes needed:
Set default routing rules in Rails app
Make sidekiq-cluster listen to an additional default and mailers queue, if default routing rules is used and regardless of whether queue selector is used. This logic ensures all Sidekiq processes are still processing all jobs regardless of queue selector.
According to the docs, default,mailers will spawn 1 process to process both queues. However, Omnibus runs the sidekiq with space delimited queues which results in spawning 1 process for each queue (e.g. default mailers).
According to the docs, default,mailers will spawn 1 process to process both queues. However, Omnibus runs the sidekiq with space delimited queues which results in spawning 1 process for each queue (e.g. default mailers).
I wonder whether we do the way around in omnibus. So that one process handles both default and mailers queues
It means we can change the other MR's queue groups to the following config. Doing that keeps the prior behavior of omnibus, which it spawns 1 process to handle all queues.
Valid point. I was also thinking about the same since previously we also had 1 process to watch all queues also. Will do the necessary on the other MR then, thanks!
Omnibus by nature has access to more of a system than a container in Kubernetes. Kubernetes can see that it needs more workers, and spawn on demand. Omnibus must start them all at once.
@WarheadsSE That is a very good idea. Just to verify your point, updating the Rails initializer will automatically update the default values for Omnibus and Helm chart, right?
Will there be any drawbacks to updating the initializer only?
Will there be any drawbacks to updating the initializer only?
If there is no setting passed which will override it, then this is what is used. If there is / was some value set by the end user, even setting defaults in multiple locations will not override what the user has provided.
By placing this here, we can continue without having to provide these default contents in any consumer.
Say currently we're running 15.0, and we have 400+ queues, if 15.4 only includes the Rails changes we'd be fine. But with the omnibus change on Sidekiq server default, some jobs won't be picked up including retry and scheduled jobs.
Yes, we need to do job migration. I think we can include a Rails DB migration to trigger this? It will be fine to do that in a later release, before merging the omnibus MR.
As you mentioned in the omnibus MR, we should be able to automatically fill in the queues based on the routing rules if the user hasn't set anything.
marked the checklist item Add entry in version upgrade instructions for 16.0 about the above changes. as completed
Marco (Gregorius)marked the checklist item Make sidekiq-cluster listen to an additional default and mailers queue, if default routing rules is used and regardless of whether queue selector is used. This logic ensures all Sidekiq processes are still processing all jobs regardless of queue selector. as completed
marked the checklist item Make sidekiq-cluster listen to an additional default and mailers queue, if default routing rules is used and regardless of whether queue selector is used. This logic ensures all Sidekiq processes are still processing all jobs regardless of queue selector. as completed
Marco (Gregorius)marked the checklist item Set default routing rules in Rails app as completed
marked the checklist item Set default routing rules in Rails app as completed