Fine tune dynamic mirroring in production
We shipped https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1853 and this is bringing a new challenge on capacity planning for sidekiq.
This means that we need to keep a close eye on how this feature behaves and we need to monitor it closely.
For this we will use our current sidekiq monitoring paying special attention to the project_mirror queue and querying redis directly to know how much capacity we have left at any given point in time.
For this we will use this script from rails console:
Gitlab::Mirror.available_capacity
We expect to be close to 0 at any given point, but we will just report what the value is to gather data and learn.