Improve performance of show and #show.json actions for Projects::PipelinesController under load into next tier
Summary
New performance test for 'Get a single pipeline' (GET /:group/:project/pipelines/:pipeline_id
) revealed that Projects::PipelinesController#show
and Projects::PipelinesController#show.json
controller actions are over our performance target of 500ms under load:
* Environment: 10k
* Environment Version: 13.9.0-pre `b44fe05ca4f`
* Option: 60s_200rps
* Date: 2021-02-08
* Run Time: 2m 17.21s (Start: 18:29:52 UTC, End: 18:32:09 UTC)
* GPT Version: v2.5.1
NAME | RPS | RPS RESULT | TTFB AVG | TTFB P90 | REQ STATUS | RESULT
----------------------------------|-------|----------------------|----------|---------------------|----------------|--------
web_project_pipelines_pipeline | 20/s | 19.18/s (>16.00/s) | 732.91ms | 1565.42ms (<2500ms) | 100.00% (>99%) | Passed
Detailed Stats:
█ Web - Project Pipelines Page
data_received.................................: 72 MB 1.2 MB/s
data_sent.....................................: 142 kB 2.3 kB/s
group_duration................................: avg=3858.97ms min=2054.68ms med=3883.98ms max=5406.40ms p(90)=4422.94ms p(95)=4716.34ms
http_req_blocked..............................: avg=17.17ms min=0.00ms med=31.84ms max=47.29ms p(90)=32.88ms p(95)=33.17ms
http_req_connecting...........................: avg=16.83ms min=0.00ms med=31.71ms max=47.19ms p(90)=32.77ms p(95)=33.03ms
http_req_duration.............................: avg=775.01ms min=92.14ms med=614.87ms max=4980.00ms p(90)=1660.81ms p(95)=2436.26ms
http_req_receiving............................: avg=42.02ms min=0.04ms med=0.24ms max=106.76ms p(90)=96.07ms p(95)=96.57ms
http_req_sending..............................: avg=0.07ms min=0.02ms med=0.08ms max=0.22ms p(90)=0.12ms p(95)=0.13ms
http_req_tls_handshaking......................: avg=0.00ms min=0.00ms med=0.00ms max=0.00ms p(90)=0.00ms p(95)=0.00ms
http_req_waiting..............................: avg=732.91ms min=92.01ms med=614.68ms max=4884.44ms p(90)=1565.42ms p(95)=2340.91ms
✓ { endpoint:/pipeline.json }.................: avg=997.75ms min=778.86ms med=909.67ms max=1737.42ms p(90)=1241.14ms p(95)=1289.83ms
✓ { endpoint:/pipeline/status.json }..........: avg=140.10ms min=112.89ms med=133.58ms max=537.40ms p(90)=166.59ms p(95)=191.45ms
✓ { endpoint:/pipeline/tests/summary.json }...: avg=112.90ms min=92.01ms med=103.41ms max=614.68ms p(90)=124.42ms p(95)=145.43ms
✓ { endpoint:/pipeline }......................: avg=1682.99ms min=1121.85ms med=1493.94ms max=4884.44ms p(90)=2633.80ms p(95)=2883.90ms
✓ http_reqs.....................................: 1185 19.179629/s
✓ { endpoint:/pipeline.json }.................: 296 4.790861/s
✓ { endpoint:/pipeline/status.json }..........: 296 4.790861/s
✓ { endpoint:/pipeline/tests/summary.json }...: 296 4.790861/s
✓ { endpoint:/pipeline }......................: 296 4.790861/s
iteration_duration............................: avg=3846.51ms min=148.02ms med=3883.84ms max=5406.42ms p(90)=4421.95ms p(95)=4715.93ms
iterations....................................: 296 4.790861/s
✓ successful_requests...........................: 100.00% ✓ 1184 ✗ 0
vus...........................................: 5 min=4 max=20
vus_max.......................................: 20 min=20 max=20
- Server Performance dashboard: https://snapshot.raintank.io/dashboard/snapshot/p4QeENDAc8IUIuDVglnO20B8mLdpiXy0
- There is no obvious problem in CPU or memory usage
Steps to reproduce
- Check out the Performance Tool
- Run the specific test with the
run-k6
command. For example against the 10k environment you would run this following from the project root:./run-k6 -e environments/10k.json -o 60s_200rps.json -t web_project_pipelines_pipeline.js
. You will need an ACCESS_TOKEN for this endpoint as well. - If you're seeking to run the test against your own environment the Tool's documentation has details on how to achieve this.
What is the current bug behavior?
The results above show that the #show
and #show.json
actions for the Projects::PipelinesController
controller has a P90 of 2633.80ms
and 1241.14ms
accordingly. This was targeted against this pipeline.
What is the expected correct behavior?
As per our performance targets this endpoint is above our main target of 500ms and falls under the ~S3 tier. Task is to improve the endpoint's performance under load into next tier.