Merge pull request https://github.com/kubernetes/contrib/pull/1170 from fgrzadkowski/faster_loop
cluster-autoscaler: Increase main loop frequency to 10s
This commit is contained in:
commit
2d3c74f953
|
|
@ -49,8 +49,9 @@ var (
|
||||||
"How long the node should be unneeded before it is eligible for scale down")
|
"How long the node should be unneeded before it is eligible for scale down")
|
||||||
scaleDownUtilizationThreshold = flag.Float64("scale-down-utilization-threshold", 0.5,
|
scaleDownUtilizationThreshold = flag.Float64("scale-down-utilization-threshold", 0.5,
|
||||||
"Node utilization level, defined as sum of requested resources divided by capacity, below which a node can be considered for scale down")
|
"Node utilization level, defined as sum of requested resources divided by capacity, below which a node can be considered for scale down")
|
||||||
scaleDownTrialFrequency = flag.Duration("scale-down-trial-frequency", 10*time.Minute,
|
scaleDownTrialInterval = flag.Duration("scale-down-trial-interval", 10*time.Minute,
|
||||||
"How often scale down possiblity is check")
|
"How often scale down possiblity is check")
|
||||||
|
scanInterval = flag.Duration("scan-interval", 10*time.Second, "How often cluster is reevaluated for scale up or down")
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
@ -116,7 +117,7 @@ func main() {
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-time.After(time.Minute):
|
case <-time.After(*scanInterval):
|
||||||
{
|
{
|
||||||
loopStart := time.Now()
|
loopStart := time.Now()
|
||||||
updateLastTime("main")
|
updateLastTime("main")
|
||||||
|
|
@ -204,7 +205,7 @@ func main() {
|
||||||
|
|
||||||
// In dry run only utilization is updated
|
// In dry run only utilization is updated
|
||||||
calculateUnneededOnly := lastScaleUpTime.Add(*scaleDownDelay).After(time.Now()) ||
|
calculateUnneededOnly := lastScaleUpTime.Add(*scaleDownDelay).After(time.Now()) ||
|
||||||
lastScaleDownFailedTrial.Add(*scaleDownTrialFrequency).After(time.Now()) ||
|
lastScaleDownFailedTrial.Add(*scaleDownTrialInterval).After(time.Now()) ||
|
||||||
schedulablePodsPresent
|
schedulablePodsPresent
|
||||||
|
|
||||||
updateLastTime("findUnneeded")
|
updateLastTime("findUnneeded")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue