Description
pprof file:pprof.zip
Please provide an in-depth description of the question you have:
We want to use the resourceregistry CR of karmada-search to cache resources in order to avoid the issue of the apiserver crashing due to a large number of informer list requests.
So, we conducted a performance test,and here is the test situation.
Testing Environment
2 k8s cluster. one is admin cluster,another one is member cluster
Test case
I want to simulate a list request that responds with a large number of resources at once.
- Create 200 secrets in the member cluster, with each secret being 1M in size, expecting a single list to return 200M of data.
- Cache the secrets of the member cluster through the ResourceRegistry.
after normal startup and resource cached
start 1 informer
alloc_space
cpu
memory usage
The maximum value reached 1.8G.
start 5 informer
alloc_space
cpu
memory usage
The maximum value reached 5.86G.
start 10 informer
OOM, karmada-seach pod restarts because I set the limit to 8G,message from describe pod
Reason: OOMKilled
What do you think about this question?:
I think the use of memory seems a bit abnormal.I assumed that one informer request would consume around 200M of memory, but in the program, the actual allocation exceeded 1G.
At the same time, two problems were found.
- From the memory profile,it can be seen that memory growth is mainly due to byte.growSlice.
- From the cpu profile,it can be seen that runtime.memclrNoheapPointers takes a longer time.
k8s official solution for this situation is to enable watchlist, but it requires a higher version.
We want to use the karmada-search solution in a lower-version cluster.
Are there any optimization solutions?
Environment:
- Karmada version: 1.12
- Kubernetes version:
- Others:
Activity