Improve performance of variables API under load into main tier

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

The TTFB (Time to First Byte) of the variables API degraded on December 2022:

Screenshot_2023-01-24_at_11.57.53

This happened between 2022-12-13 and 2022-12-15

Screenshot_2023-01-24_at_12.03.00

Detailed results

The TTFB (Time to First Byte) of the List project variables API is slightly over our performance target under load:

* Environment:                10k
* Environment Version:        15.7.0-pre `8b69da628bf`
* Option:                     60s_200rps
* Date:                       2022-12-21
* Run Time:                   1h 40m 44.21s (Start: 04:46:41 UTC, End: 06:27:25 UTC)
* GPT Version:                v2.12.1

NAME                                                     | RPS   | RPS RESULT           | TTFB AVG  | TTFB P90              | REQ STATUS     | RESULT 
---------------------------------------------------------|-------|----------------------|-----------|-----------------------|----------------|--------
scenario_api_list_project_variables                      | 1/s   | 1.0/s (>0.64/s)      | 139.80ms  | 208.11ms (<200ms)     | 100.00% (>99%) | FAILED²

Note that TTFB increased from 150ms at 2022-12-14 to 200ms after 2022-12-15:

Screenshot_2022-12-21_at_15.35.45

  • 2022-12-14 GitLab version 15.7.0-pre - c458f253b88
  • 2022-12-15 GitLab version 15.7.0-pre - 52062182e8c

Changes - https://gitlab.com/gitlab-org/gitlab/-/compare/c458f253b88...52062182e8c?from_project_id=278964&straight=false

Create a new group variable API

Similar degradation is seen in Creates a new group variable test:

Screenshot_2023-01-23_at_11.37.26

* Environment:                10k
* Environment Version:        15.9.0-pre `22363673bf7`
* Option:                     60s_200rps
* Date:                       2023-01-23
* Run Time:                   1h 40m 50.75s (Start: 04:50:52 UTC, End: 06:31:43 UTC)
* GPT Version:                v2.12.2

NAME                                                     | RPS   | RPS RESULT           | TTFB AVG  | TTFB P90              | REQ STATUS     | RESULT 
---------------------------------------------------------|-------|----------------------|-----------|-----------------------|----------------|--------
scenario_api_new_group_variables                         | 1/s   | 1.01/s (>0.64/s)     | 134.43ms  | 212.02ms (<200ms)     | 100.00% (>99%) | FAILED²

Create a new project variable API

Similar degradation is seen in Creates a new project variable test - the results becam more spiky after December 2022:

Screenshot_2023-01-24_at_11.19.22

* Environment:                10k
* Environment Version:        15.9.0-pre `9a7ab190daf`
* Option:                     60s_200rps
* Date:                       2023-01-24
* Run Time:                   1h 38m 25.23s (Start: 04:47:58 UTC, End: 06:26:23 UTC)
* GPT Version:                v2.12.2
❯ Overall Results Score: 97.74%
NAME                                                     | RPS   | RPS RESULT           | TTFB AVG  | TTFB P90              | REQ STATUS     | RESULT 
---------------------------------------------------------|-------|----------------------|-----------|-----------------------|----------------|--------
scenario_api_new_project_variables                       | 1/s   | 1.01/s (>0.64/s)     | 144.45ms  | 235.85ms (<200ms)     | 100.00% (>99%) | FAILED²

Test Details

Testing was done on our 10k Reference Architecture environment with our lab condition GitLab Performance Tool pipeline. The project being tested is a copy of gitlabhq (tarball can be found here). GitLab Performance Tool tests information is listed at Current test details page.

The latest GitLab Performance pipeline results can always be found here. Through this page full Server Metrics can be found via the Metrics Dashboard link on that page.

As per our performance targets this endpoint's TTFB metric is above the target of 200 ms which is severity4. Task is to improve the endpoint's performance into next tier.

Edited by 🤖 GitLab Bot 🤖