Improve performance of index action for Projects::TagsController to meet target
After adding in a new performance test for Project Tags webpage, the index
action of the Projects::TagsController
was found to be slightly unperformant:
█ Results summary
* Environment: 10k
* Environment Version: 13.8.0-pre `41feec7b142`
* Option: 60s_200rps
* Date: 2021-01-22
* Run Time: 1m 4.68s (Start: 11:00:55 UTC, End: 11:01:59 UTC)
* GPT Version: v2.5.0
NAME | RPS | RPS RESULT | TTFB AVG | TTFB P90 | REQ STATUS | RESULT
-----------------|------|--------------------|----------|--------------------|----------------|----------------
web_project_tags | 20/s | 18.62/s (>12.80/s) | 601.34ms | 685.56ms (<1500ms) | 100.00% (>99%) | Passed
Looking at the metrics nothing specifically looks to be getting stressed to hard:
Testing was done as part of our normal performance tests on the 10k Reference Architecture at Web rate of 20 RPS. In our test data (based on the main GitLab project) there are numerous tags.
As per our performance targets the controller action is above our main target of 200ms and falls under the severity4 tier. Task is to improve the actions performance to meet the target.
Implementation plan
- Only load tags that are shown on the page
- Set
gitaly_pagination
totrue
when callingTagsFinder#execute
- There may be other changes required to make the UI work with this
- Set
- Batch load CI builds
- There are currently N+1 queries for Builds, initiated by the download button template
- Any other optimizations that can be found
Edited by Alishan Ladhani