Skip to content

Improve performance of show.json action (rendered) for Projects::BlobController under load into the s2 tier

The Projects::BlobController#show.json controller and action has been found to perform badly under load for files that are shown in the rendered (files that are shown with the viewer=rich param, e.g. markdown files) view and is over our new performance target of 500ms.

This was found through work on #217580 (closed) where the extra work needed to show the rendered file was found to add notable delay.

█ Results summary

* Environment:                10k
* Environment Version:        13.1.0-pre `9ace12e4a21`
* Option:                     60s_200rps
* Date:                       2020-06-17
* Run Time:                   1m 2.49s (Start: 16:26:40 UTC, End: 16:27:42 UTC)
* GPT Version:                v2.0.2

NAME                      | RPS  | RPS RESULT       | TTFB AVG  | TTFB P90              | REQ STATUS     | RESULT
--------------------------|------|------------------|-----------|-----------------------|----------------|----------------
web_project_file_rendered | 20/s | 1.77/s (>0.80/s) | 8456.90ms | 22994.71ms (<30000ms) | 100.00% (>95%) | Passed

Metrics:

Screenshot_2020-06-18_at_08.47.27

As shown the test found that the page performs at a bad level with it returning a time to first byte result of around 23s. This was done against a "worse case" file, CHANGELOG.md, (~770kb).

As part of the new performance targets this page is unfortunately over our TTFB target and falls into the ~S2 tier.

Task is to reduce the performance of this page to the next tier of ~S3 (<2000ms).