Limit number of branches/tags loaded from Gitaly
What does this MR do and why?
Problem
We load all tags and branches from Gitaly and then apply the 100 elements limit. This approach has a poor performance.
Kibana: https://log.gprd.gitlab.net/goto/4a3ddb40-2778-11ed-8656-f5f2137823ba
Solution
Gitaly API supports pagination, instead of loading all tags/branches we can load only necessary 100 elements. This will prevent connection timeouts from Gitaly.
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
- Enable feature flag
Feature.enable(:use_gitaly_pagination_for_refs)
- Visit http://127.0.0.1:3000/gitlab-org/gitlab-test/refs
- You should see same branches and tags as without feature flag
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Vasilii Iakliushin