Skip to content

Fix blobs search API degradation

Dmitry Gruzd requested to merge search-scope-blobs-fix into master

What does this MR do?

Affects only non Advanced Search queries.

This MR fixes a performance degradation of the Blobs search API when we get a lot of matches from Gitaly for the search string. We achieve that by limiting the number of results we receive from gitaly in Ruby code. The next step could be to limit the number of results in Gitaly itself.

The only user facing change is that at the search page we would show 99+ instead of the exact number when there are more than 100 results.

Screenshot_2020-02-12_at_10.03.22

The issue originally was discovered in #33562 (closed)

Testing with the Performance toolkit

Before:

NAME RPS RPS RESULT TTFB AVG TTFB P90 REQ STATUS RESULT
api_v4_projects_project_search_blobs 2/s 0.95/s (>1.60/s) 1388.48ms 1899.62ms (<500ms) 100.00% (>95%) FAILED²

¹ Result covers endpoint(s) that have known issue(s). Threshold(s) have been adjusted to compensate.

² Failure may not be clear from summary alone. Refer to the individual test's full output for further debugging.

After:

NAME RPS RPS RESULT TTFB AVG TTFB P90 REQ STATUS RESULT
api_v4_projects_project_search_blobs 2/s 1.95/s (>1.60/s) 242.60ms 310.07ms (<500ms) 100.00% (>95%) Passed

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖

Merge request reports