huawei-cloudnative / firmament

The Firmament cluster scheduling platform
http://www.firmament.io
Apache License 2.0
19 stars 9 forks source link

Pod Affinity/Anti-Affinity optimization #39

Closed shivramsrivastava closed 5 years ago

shivramsrivastava commented 5 years ago

This PR improves the pod Affinity/Anti-affinity performance. Currently we process pod by pod for all pods having pod affinity/anti-affinity. With this change we group pods that can be processed together and separate other pods that need to be processed one by one. This is done before scheduling by analysing the Affinity/Anti-affinity conflicts among pods and grouping into sets of pods that can be processed together. The pod that do not have conflict with other pods can be processed in batch with those pods and the pods that have conflict with all other pods shall be processed one by one. So lesser the affinity/anti-affinity conflicts among pending pods better is the performance of scheduling.