karmada icon indicating copy to clipboard operation
karmada copied to clipboard

make buildInformerForCluster configurable

Open snowplayfire opened this issue 3 years ago • 13 comments

What type of PR is this?

/kind feature

What this PR does / why we need it: When member cluster is large(3k nodes, 10w pods), karmada-controller-manager is easy to be OOMkilled and retry to sync nodes and pods again and again, the member cluster also stays in unknown.

Whether to execute buildInformerForCluster() to sync nodes and pods should be configurable especially for large cluster.

Does this PR introduce a user-facing change?:

A new flag `build-informer-for-cluster` for controller-manager and agent.

snowplayfire avatar May 21 '22 19:05 snowplayfire

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign kevin-wangzefeng after the PR has been reviewed. You can assign the PR to them by writing /assign @kevin-wangzefeng in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

karmada-bot avatar May 21 '22 19:05 karmada-bot

When member cluster is large(3k nodes, 10w pods), karmada-controller-manager is easy to be OOMkilled

That's very bad. I wonder to know how many memory reserved for karmada-controller-manager?

RainbowMango avatar May 23 '22 01:05 RainbowMango

Yeah I have the same concern, control-plane stores all pods and nodes(for push mode clusters) in the informer cache, which consumes lots of memory in large scale scenarios

IMO we can transform objects in informers, this is a new feature in client-go 0.24 while we are using 0.23 now

dddddai avatar May 23 '22 02:05 dddddai

@dddddai Great idea, I like this feature! Just created #1866 to track this. Let's do it at release-1.3.

Before that feature, I still want to know more details about how bad the situation is now. It can also evaluate the effect of this feature in the future.

RainbowMango avatar May 23 '22 03:05 RainbowMango

When member cluster is large(3k nodes, 10w pods), karmada-controller-manager is easy to be OOMkilled

That's very bad. I wonder to know how many memory reserved for karmada-controller-manager?

One cluster with 3k nodes and 10w pods needs rough100G( far exceed 100G when cluster failure occurs) for kube-controller-manager, so karmada-controller-manager may need more than 100G * n, n is the number of clusters.

snowplayfire avatar May 23 '22 04:05 snowplayfire

One cluster with 3k nodes and 10w pods needs rough100G( far exceed 100G when cluster failure occurs) for kube-controller-manager, so karmada-controller-manager may need more than 100G * n, n is the number of clusters.

I'm very surprised! @Poor12 is leading the effort to do performance testing and improvement. He might confirm it later.

But if we don't sync node and pods here, we can't get the resource summary, then the general estimator will always deny workloads as no resources left .
https://github.com/karmada-io/karmada/blob/d9b043bedd4507b9f81196f55ff1bd3fd5df6ab0/pkg/estimator/client/general.go#L36-L39

RainbowMango avatar May 23 '22 13:05 RainbowMango

@RainbowMango member cluster probably can calculate resource summary and report to fed cluster.

snowplayfire avatar May 30 '22 03:05 snowplayfire

@RainbowMango member cluster probably can calculate resource summary and report to fed cluster.

I'm not sure if you are saying that karmada-agent now takes the responsibility to report resource summary for clusters in Pull mode.

RainbowMango avatar May 30 '22 06:05 RainbowMango

I want to let you know that @Poor12 is trying to figure out how serious the issue is.

Let's wait for a while. cc guys who met this situation here. cc @likakuli

RainbowMango avatar Jun 16 '22 08:06 RainbowMango

copy that, thx

likakuli avatar Jun 16 '22 08:06 likakuli

@snowplayfire We have been doing performance tests on this for the last few weeks. Now we can confirm that there is a performance issue but seems not so bad as mentioned on https://github.com/karmada-io/karmada/pull/1858#issuecomment-1134170421.

There are several improvement ideas:

    1. change the generic informer to typed informer which is addressed by #2318
    1. Add the cache then we don't need to list all things out. it is addressed by #2034
    1. Adopt informer transform func to save memory. It is addressed by #2089

I think it's fair enough to make a flag for people to enable/disable the resource-modeling thing. Since we are going to make changes to the code that this PR also touching, I'd like to move this forward first to avoid conflict.

I'm sorry for let this sit so long, now there has conflicts that need to be resolved, please let me know if you can solve them and push again.

RainbowMango avatar Aug 05 '22 07:08 RainbowMango

Hi @snowplayfire Your branch has conflicts with the master, you might need to rebase your branch.

By the way, I see you are using your Chinese name in commit author:

Author: ljx李静雪 <[email protected]>

RainbowMango avatar Aug 10 '22 06:08 RainbowMango

Hi @snowplayfire Your branch has conflicts with the master, you might need to rebase your branch.

By the way, I see you are using your Chinese name in commit author:

Author: ljx李静雪 <[email protected]>

done

snowplayfire avatar Aug 10 '22 07:08 snowplayfire

Hi @snowplayfire I picked your commit and fixed the conflicts as well as my comments at #2387.

RainbowMango avatar Aug 16 '22 13:08 RainbowMango