Use runtime.NumCPU() instead of a fixed value for parallel scheduler threads.

This commit is contained in:
Bobby (Babak) Salamat
2019-02-11 13:37:30 -08:00
parent f7c4389b79
commit d0ebeefbc4
3 changed files with 9 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ package priorities
import (
"context"
"runtime"
"sync"
"k8s.io/api/core/v1"
@@ -211,7 +212,7 @@ func (ipa *InterPodAffinity) CalculateInterPodAffinityPriority(pod *v1.Pod, node
}
}
}
workqueue.ParallelizeUntil(context.TODO(), 16, len(allNodeNames), processNode)
workqueue.ParallelizeUntil(context.TODO(), runtime.NumCPU(), len(allNodeNames), processNode)
if pm.firstError != nil {
return nil, pm.firstError
}