Improve performance of diffs_metadata action for Projects::MergeRequests::DiffsController under load to target
Performance testing shows that the diffs_metadata
action for the Projects::MergeRequests::DiffsController
controller is performing slightly above the target of 200ms:
* Environment: 10k
* Environment Version: 14.4.0-pre `a03f6bef75b`
* Option: 60s_200rps
* Date: 2021-10-19
* Run Time: 1h 28m 30.72s (Start: 04:36:22 UTC, End: 06:04:53 UTC)
* GPT Version: v2.9.0
NAME | RPS | RPS RESULT | TTFB AVG | TTFB P90 | REQ STATUS | RESULT
---------------------------------------------------------|-------|----------------------|-----------|----------------------|----------------|--------
web_project_merge_request_changes | 20/s | 18.99/s (>16.00/s) | 310.23ms | 344.26ms (<1500ms) | 100.00% (>99%) | Passed
http_req_waiting................................................................: avg=310.23ms min=148.64ms med=257.36ms max=3532.18ms p(90)=344.26ms p(95)=412.00ms
✓ { controller:Projects::MergeRequests::DiffsController#diffs_batch.json }......: avg=321.55ms min=148.64ms med=267.29ms max=3532.18ms p(90)=348.31ms p(95)=428.42ms
✓ { controller:Projects::MergeRequests::DiffsController#diffs_metadata.json }...: avg=206.39ms min=175.10ms med=197.79ms max=411.47ms p(90)=238.49ms p(95)=260.20ms
The endpoint was tested on our 10k Reference Architecture with a RPS target of 20/s against the page (spread across each controller action). It targeted an MR on our own gitlabhq
project that has a 99th percentile of changes - 187.
As per our performance targets the controller action is above our main target of 200ms and fall under the severity4 tier. Task is to improve the action's performance to meet the target of 200ms.