-
Task
-
Resolution: Done
-
Major
-
None
-
None
During pruning the operator repeatedly performs discovery calls on the OpenShift API. This happens because the pruner tries to list nonexistent resource types. This causes the cached discovery information to be invalidated and re-read from the API. API discovery requires around 90 API requests (and even more if the cluster contains many CRDs). On my cluster, this discovery is performed 20+ times every time the prune operation is performed, resulting in a total of 2000+ API requests being performed. With the default rate limiting settings (apiBurst 50, QPS 25), pruning takes 80+ seconds.
By eliminating these unnecessary API discovery requests, the number of API requests required for pruning can be reduced to less than 40. With apiBurst set to 50, this means that no throttling would occur. The prune operation would thus take less much less than a second.