-
Notifications
You must be signed in to change notification settings - Fork 224
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
perf: Cache requirements for pods alongside requests #1950
base: main
Are you sure you want to change the base?
perf: Cache requirements for pods alongside requests #1950
Conversation
e31f059
to
3645b79
Compare
Pull Request Test Coverage Report for Build 13143439974Details
💛 - Coveralls |
@@ -265,10 +273,24 @@ func (s *Scheduler) Solve(ctx context.Context, pods []*corev1.Pod) Results { | |||
} | |||
} | |||
|
|||
func (s *Scheduler) updateCachedPodData(p *corev1.Pod) { | |||
podData := PodData{ |
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.
Want to make the requirements before the struct and then assign to both struct members when making podData
?
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.
Do you think that makes it easier to parse? I'm not really seeing a ton of value though -- though, I'm not 100% what you mean
/lgtm |
3645b79
to
d39172c
Compare
d39172c
to
d3e51f5
Compare
d3e51f5
to
3ad4e57
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jonathan-innis, rschalo 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 |
Fixes #N/A
Description
Cache requirements for pods alongside requests so we don't have to spend memory continually re-creating the pod requirements when we are iterating through the pods in our scheduling loops. This also prevents the garbage collector from having to run as frequently since there will be more live memory that is being used in the scheduling loop
These changes were executed against the scheduling benchmark (which showed negligible performance changes) and a live test that deploys 20,000 pods to the cluster and generates 10,000 nodes (with two pods per node constrained by the size of the instance types on NodePools). Prior to the change, this test took 27m17s. After the change, the same test case takes 25m24s (a 1m53s improvement).
Before PR
Scheduling Benchmark
Heap Profiles
Alloc Space
Inuse Space
Live Test
Scheduling Time: 27m17s
After PR
Scheduling Benchmark
Heap Profiles
Alloc Space
Inuse Space
Live Test
Scheduling Time: 25m24s
How was this change tested?
make presubmit
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.