Select statements that are in execution during database CPU utilization peak times - licenses table
After investigating spikes over 70% of CPU usage on the database here:
Link to reports/investigations
we find out this statement being executed thousands of times:
Query |
---|
SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT $1 |
Could be possible creating or improving our caching on those tables? Could we have a unified cache to query, and when we execute updates on it, we could refresh the cache?
Metrics
Collected from https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/snippets/2047044
Metric | Measurement |
---|---|
Total number of calls | |
% of Total time | |
TPS | |
Duration |