Skip to content

Reduce the number of custom role queries

Problem

  • The groups custom role query runs 10M times in 24 hours and the projects custom role queries runs 300M times 24 hours, #508616 (comment 2379326977)
  • The objective is to figure out where we are running the custom role queries unnecessarily and fix those

Solution

  • Ensure custom role queries aren't being run if no custom roles are configured on the namespace - !191643 (merged)
  • Ensure custom role queries aren't being run for owners in a group / maintainers+ in a project - #547086 (closed)
  • Analyse which endpoints are triggering custom role queries from the logs, and check to see if they are necessary. For example, Projects::JobsController#show gets polled every 10 seconds and it triggers a new custom role query every 10 seconds - but does it need to? - !195094 (merged)
Edited by Hinam Mehra