Skip to content

Improve performance of show action for Projects::CommitController under load into S2 tier

After adding in a new test for the Commit details page it was found that the show action for the Projects::CommitController is unperformant:

* Environment:                10k
* Environment Version:        13.3.0-pre `9cda1414a43`
* Option:                     60s_200rps
* Date:                       2020-07-28
* Run Time:                   1m 15.64s (Start: 09:10:21 UTC, End: 09:11:37 UTC)
* GPT Version:                v2.0.5

NAME               | RPS  | RPS RESULT       | TTFB AVG  | TTFB P90              | REQ STATUS     | RESULT
-------------------|------|------------------|-----------|-----------------------|----------------|----------------
web_project_commit | 20/s | 5.78/s (>3.20/s) | 2997.63ms | 10127.84ms (<12500ms) | 100.00% (>95%) | Passed

    http_req_waiting.....................: avg=2997.63ms min=54.91ms   med=85.65ms   max=13182.73ms p(90)=10127.84ms p(95)=10337.54ms
    ✓ { endpoint:branches }..............: avg=96.55ms   min=54.91ms   med=64.62ms   max=556.35ms   p(90)=202.32ms   p(95)=217.91ms
    ✓ { endpoint:commit }................: avg=9819.58ms min=8657.37ms med=9493.09ms max=13182.73ms p(90)=11369.70ms p(95)=11647.16ms
    ✓ { endpoint:merge_requests.json }...: avg=118.61ms  min=62.87ms   med=73.31ms   max=1267.09ms  p(90)=208.43ms   p(95)=233.60ms

These were tested on our 10k Reference Architecture with a RPS target of 20/s against a real large commit (86 changed files with 1992 additions and 135 deletions, can be seen on staging here) spread across each controller action.

As per our performance targets these controller actions are above our main target of 500ms and fall under the ~S1 tier. Task is to improve each action's performance into the next tier ~S2 (<9000ms).

Edited by Grant Young