Skip to content

Reduce SQL timings in Projects::MergeRequestsController#ci_environments_status.json

The controller Projects::MergeRequestsController#ci_environments_status.json is one of our most frequently requested controllers with a 99th percentile (of SQL query timings) above 200 milliseconds. According to our daily overview the statistics are as follows:

  • 401 000 requests per 12 hours
  • 58.8% of the request time is spent in SQL

SQL timings per request:

  • Mean: 50.93 ms
  • 95th percentile: 136.97 ms
  • 99th percentile: 717.06 ms

This controller should be improved so that the 99th percentile is consistently below 200 milliseconds, with an ideal target of 100 - 150 milliseconds.

TODO

  • Remove the index yorick_deployments_test once our query improvements have been deployed
Edited by Yorick Peterse