Skip to content

Use native Gitaly pagination for Branch list API

What does this MR do?

This MR improves the api/project/:id/repository/branches performance by using Gitaly's native pagination gitaly!2251 (merged).

It utilizes page_token(branch name in this case) instead of the default page from Kaminari. It would require API doc changes as well.

Also, as a first iteration, it only works when names or search params were not used.

Before

█ Results summary

* Environment:                Localhost
* Environment Version:        13.2.0-pre `1f57dc1a965`
* Option:                     60s_20rps
* Date:                       2020-07-03
* Run Time:                   1m 1.53s (Start: 07:46:59 UTC, End: 07:48:01 UTC)
* GPT Version:                v2.0.4

NAME                                | RPS  | RPS RESULT       | TTFB AVG  | TTFB P90            | REQ STATUS     | RESULT
------------------------------------|------|------------------|-----------|---------------------|----------------|----------------
api_v4_projects_repository_branches | 20/s | 3.98/s (>3.20/s) | 2472.55ms | 3824.12ms (<7500ms) | 100.00% (>95%) | Passed

After

█ Results summary

* Environment:                Localhost
* Environment Version:        13.2.0-pre `1f57dc1a965`
* Option:                     60s_20rps
* Date:                       2020-07-03
* Run Time:                   2m 2.96s (Start: 07:51:45 UTC, End: 07:53:48 UTC)
* GPT Version:                v2.0.4

NAME                                | RPS  | RPS RESULT       | TTFB AVG  | TTFB P90            | REQ STATUS     | RESULT
------------------------------------|------|------------------|-----------|---------------------|----------------|-----------------
api_v4_projects_repository_branches | 20/s | 2.38/s (>3.20/s) | 4340.72ms | 6978.34ms (<7500ms) | 100.00% (>95%) | FAILED²

Screenshots

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

Relates to #208738 (closed)

Edited by Sincheol (David) Kim

Merge request reports