Add ManagedCluster informer to improve performance #117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We got a higher latency when using cluster-gateway with
ocm-integration=true
to access managed cluster k8s resources.And through e2e benchmark test, I found that cluster-gateway will get ManagedCluster per request, and sometimes it will cost X*100ms(sometimes X senconds in the production environment).
ManagedCluster is not got from cache,so I add ManagedCluster informer to improve performance, and according to the result of e2e benchmark, the latency is greatly reduced.
add arg
--v=4
to gateway-deployment, and then run multicluster e2e benchmark test case test case, I copy the logs of some high latency requests below:the result of e2e benchmark before adding ManagedCluster informer:
the result of e2e benchmark after adding ManagedCluster informer: