-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scheduler: preallocation for NodeToStatusMap #124714
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/cc @alculquicondor |
|
||
allNodes, err := sched.nodeInfoSnapshot.NodeInfos().List() | ||
if err != nil { | ||
return nil, diagnosis, err | ||
return nil, framework.Diagnosis{ | ||
NodeToStatusMap: make(framework.NodeToStatusMap), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think .List
would fail for the snapshot, but couldn't it be left nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 and maybe we can defer the allocation until unsuccess real happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldn't it be left nil?
Ah, yes we can just leave it nil.
@kerthcet Can you elaborate about your proposal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean we can make the map (allocate the memory) when pod unschedulable real happens rather than preallocate, especially for 5k nodes, however, scheduling runs in serial, so the benefit is small but will make the code more complicated, so this is not a good suggestion. 😢
This patch allows us to reach 300 pods/s again |
/lgtm Can you open a cherry-pick for release-1.30? |
LGTM label has been added. Git tree hash: cabde4b4d4acb424ef24fafe1fce6f24db0deda6
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, sanposhiho The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Is it possible that we regressed something timing related here? See #124743 |
@saschagrunert Well... This PR is just changing the internal data structure's field to be preallocated. |
Done; #124753 |
/release-note-edit
|
…124714-upstream-release-1.30 Automated cherry pick of #124714: scheduler: preallocation for NodeToStatusMap
What type of PR is this?
/kind bug
/kind regression
What this PR does / why we need it:
Improve the throughput by a preallocation for NodeToStatusMap.
Which issue(s) this PR fixes:
Part of (hopefully fix) #124709
Edit: This was reverted in #125197 prior to release of 1.31.0
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: