Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
scheduler: performance improvement on PodAffinity #76243
What type of PR is this?
What this PR does / why we need it:
This PR tries to eliminate unnecessary Lock/Unlock in the logic of InterPodAffinity priorities. By replacing them with atomic AddInt64 can significantly improve the performance of:
Which issue(s) this PR fixes:
Special notes for your reviewer:
Above test result is run at a Baremetal machine with 8 core cpus and 32GB memory.
Does this PR introduce a user-facing change?:
@bsalamat Will update the release note.
One thing to note is that the 2X improvement is not for soft pod affinity, it's for hard pod affinity.
BTW: performance for soft(preferred) pod (anti-) affinity hasn't been measured due to lack of benchmark tests. But from the code's perspective, it's expected to have a performance improvement as well.
Why the priority changes can impact hard pod affinity is because of
[APPROVALNOTIFIER] This PR is APPROVED
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
Yeap. And hard pod anti-affinity isn't involved in Priorities, so this PR doesn't help for that case.
BTW: I'm also trying to improve hard pod anti-affinity, such as:
But I don't see either of them gains performance improvement yet. Will continue digging.
One thing that can improve performance, is to remove
NodesWithAffinityPods map[string]podsWithAffinity // map from node name to affinity pods
Apr 10, 2019
17 checks passed
@Huang-Wei Scheduling benchmarks show faster execution, but our Kubemark and real cluster benchmarks show a regression: