Set default concurrency limit based on urgency and capacity
Originated from gitlab-org/gitlab!190565 (comment 2556618734).
We need to set a default concurrency limit for all workers as they will be subject to throttling.
When a worker class doesn't have a limit statically defined, it will follow a percentage of the shard's capacity. For example, we'd have a worker on catchall that would only be allowed to use 20% of total threads (2160 concurrent jobs currently). In formula:
(threads * maxReplicas) * maxPercentage
The maxReplicas
can be exposed as an environment variable initially for .com. Once we want to support self-managed, it could be tied to routing rules.
Individual workers could adjust this percentage, and we could allow configuration to override the count altogether (#208 (closed)).
Tasks
- Inject
maxReplicas
from sidekiq charts - Set the default concurrency limit based on urgency & capacity
- Add a new percentage attribute to adjust the maxPercentage of individual worker
Edited by Marco Gregorius