Improve performance of show.json action (source) for Projects::BlobController under load into the s3 tier
The Projects::BlobController#show.json
controller and action has been found to perform badly under load for files that are shown in the source view and is over our new performance target of 500ms.
This was actually highlighted initially by a competitor that led us (Quality) to review our testing in this area. While we already had a test for this, upon review it was clear the file we targeted was too small and was adjusted accordingly to be more reflective. With the file change (640kb to 16kb) the results for the page are as follows:
█ Results summary
* Environment: 10k
* Environment Version: 13.0.0-pre `f99438802d0`
* Option: 60s_200rps
* Date: 2020-05-13
* Run Time: 1m 2.41s (Start: 11:55:32 UTC, End: 11:56:34 UTC)
* GPT Version: v1.3.0
NAME | RPS | RPS RESULT | TTFB AVG | TTFB P90 | REQ STATUS | RESULT
-----------------|------|--------------------|-----------|--------------------|----------------|------------------
web_project_file | 20/s | 11.95/s (>16.00/s) | 1570.86ms | 3197.82ms (<500ms) | 100.00% (>95%) | FAILED²³
Metrics:
As shown the test found that the page performs at a bad level with it returning a time to first byte result of around 3s. This was done against a sizeable file (~640kb), much like what our competitor used.
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).