Skip to content

Alert if a small set of queries is dominating postgresql

Normally, most of the DB workload is spread out over many different queries. If the postgres workload is dominated by only a few slow queries (because of missing indices or statistics leading to bad query plans), this can have a severe impact on overall DB performance - up to a full downtime of GitLab.com as seen in this incident - but is sometimes is hard to detect, as we will get many symptomatic alerts but no alerts directly pointing at slow queries.

We should alert if only a small set of queries is dominating the total query time, as suggested here.

corrective action for production#2885 (closed).

Edited by Henri Philipps