diff options
author | Jon Bratseth <bratseth@vespa.ai> | 2023-07-25 11:50:10 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@vespa.ai> | 2023-07-25 11:50:10 +0200 |
commit | 6e1bdfcb1f86b710a4b7dcd807c706844608aecb (patch) | |
tree | fa893b766016f69ffa24c6d11a9b871640b089d4 /node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale | |
parent | e9c4e69f619cac2399965473aedbfd642ced469a (diff) |
Set aside enough headroom rather than not scaling down at all
Diffstat (limited to 'node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale')
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocationOptimizer.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocationOptimizer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocationOptimizer.java index 7029991d7bf..42bb16005ee 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocationOptimizer.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocationOptimizer.java @@ -94,11 +94,11 @@ public class AllocationOptimizer { // Leave some headroom above the ideal allocation to avoid immediately needing to scale back up if (loadAdjustment.cpu() < 1 && (1.0 - loadWithTarget.cpu()) < headroomRequiredToScaleDown) - loadAdjustment = loadAdjustment.withCpu(1.0); + loadAdjustment = loadAdjustment.withCpu(Math.min(1.0, loadAdjustment.cpu() * (1.0 + headroomRequiredToScaleDown))); if (loadAdjustment.memory() < 1 && (1.0 - loadWithTarget.memory()) < headroomRequiredToScaleDown) - loadAdjustment = loadAdjustment.withMemory(1.0); + loadAdjustment = loadAdjustment.withMemory(Math.min(1.0, loadAdjustment.memory() * (1.0 + headroomRequiredToScaleDown))); if (loadAdjustment.disk() < 1 && (1.0 - loadWithTarget.disk()) < headroomRequiredToScaleDown) - loadAdjustment = loadAdjustment.withDisk(1.0); + loadAdjustment = loadAdjustment.withDisk(Math.min(1.0, loadAdjustment.disk() * (1.0 + headroomRequiredToScaleDown))); loadWithTarget = clusterModel.loadAdjustmentWith(nodes, groups, loadAdjustment); |