aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2021-03-16 16:11:35 +0100
committerJon Bratseth <bratseth@gmail.com>2021-03-16 16:11:35 +0100
commitca9ddc583c921ef44615e372bb46098308d4417b (patch)
tree43efea19a524d4a8cd0f28bce24ab0e574f25414
parent208da5dce760f30301538bf4b5da3d43fe95328c (diff)
Adjust read but not write load for BCP and growth
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterTimeseries.java23
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ResourceTarget.java30
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java63
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTester.java13
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainerTest.java1
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainerTester.java14
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/ScalingSuggestionsMaintainerTest.java8
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/responses/application1.json2
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/responses/application2.json2
9 files changed, 136 insertions, 20 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterTimeseries.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterTimeseries.java
index a435814c21e..3f5255c6618 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterTimeseries.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterTimeseries.java
@@ -2,16 +2,11 @@
package com.yahoo.vespa.hosted.provision.autoscale;
import com.yahoo.config.provision.ClusterSpec;
-import com.yahoo.vespa.hosted.provision.NodeList;
-import com.yahoo.vespa.hosted.provision.applications.Cluster;
import java.time.Duration;
-import java.time.Instant;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
/**
* A list of metric snapshots from a cluster, sorted by increasing time (newest last).
@@ -85,8 +80,8 @@ public class ClusterTimeseries {
else
return 0.0; // ... because load is stable
}
- if (queryRateNow() == 0) return 0.1; // Growth not expressible as a fraction of the current rate
- return maxGrowthRate / queryRateNow();
+ if (currentQueryRate() == 0) return 0.1; // Growth not expressible as a fraction of the current rate
+ return maxGrowthRate / currentQueryRate();
}
/** The current query rate as a fraction of the peak rate in this timeseries */
@@ -97,12 +92,22 @@ public class ClusterTimeseries {
return snapshots.get(snapshots.size() - 1).queryRate() / max;
}
+ public double currentQueryRate() {
+ return queryRateAt(snapshots.size() - 1);
+ }
+
+ public double currentWriteRate() {
+ return writeRateAt(snapshots.size() - 1);
+ }
+
private double queryRateAt(int index) {
+ if (snapshots.isEmpty()) return 0.0;
return snapshots.get(index).queryRate();
}
- private double queryRateNow() {
- return queryRateAt(snapshots.size() - 1);
+ private double writeRateAt(int index) {
+ if (snapshots.isEmpty()) return 0.0;
+ return snapshots.get(index).writeRate();
}
private Duration durationBetween(int startIndex, int endIndex) {
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ResourceTarget.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ResourceTarget.java
index ab6a6d548e9..a086e2f003f 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ResourceTarget.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ResourceTarget.java
@@ -54,6 +54,7 @@ public class ResourceTarget {
ClusterNodesTimeseries clusterNodesTimeseries,
AllocatableClusterResources current,
Application application) {
+ System.out.println(idealCpuLoad(scalingDuration, clusterTimeseries, application));
return new ResourceTarget(nodeUsage(Resource.cpu, clusterNodesTimeseries.averageLoad(Resource.cpu), current)
/ idealCpuLoad(scalingDuration, clusterTimeseries, application),
nodeUsage(Resource.memory, clusterNodesTimeseries.averageLoad(Resource.memory), current)
@@ -75,6 +76,8 @@ public class ResourceTarget {
public static double idealCpuLoad(Duration scalingDuration,
ClusterTimeseries clusterTimeseries,
Application application) {
+ double queryCpuFraction = queryCpuFraction(clusterTimeseries);
+
// What's needed to have headroom for growth during scale-up as a fraction of current resources?
double maxGrowthRate = clusterTimeseries.maxQueryGrowthRate(); // in fraction per minute of the current traffic
double growthRateHeadroom = 1 + maxGrowthRate * scalingDuration.toMinutes();
@@ -90,12 +93,33 @@ public class ResourceTarget {
else
trafficShiftHeadroom = application.status().maxReadShare() / application.status().currentReadShare();
- if (trafficShiftHeadroom > 2.0) // The expectation that we have almost no load with almost no queries is incorrect due
- trafficShiftHeadroom = 2.0; // to write traffic; once that is separated we can increase this threshold
+ if (trafficShiftHeadroom > 2.0) // TODO: The expectation that we have almost no load with almost no queries is incorrect due
+ trafficShiftHeadroom = 2.0; // to write traffic; now that is separated we can increase this threshold
- return 1 / growthRateHeadroom * 1 / trafficShiftHeadroom * Resource.cpu.idealAverageLoad();
+ // Assumptions: 1) Write load is not organic so we should not grow to handle more.
+ // (TODO: But allow applications to set their target write rate and size for that)
+ // 2) Write load does not change in BCP scenarios.
+ return queryCpuFraction * 1 / growthRateHeadroom * 1 / trafficShiftHeadroom * idealQueryCpuLoad() +
+ (1 - queryCpuFraction) * idealWriteCpuLoad();
+ }
+
+ private static double queryCpuFraction(ClusterTimeseries clusterTimeseries) {
+ double queryRate = clusterTimeseries.currentQueryRate();
+ double writeRate = clusterTimeseries.currentWriteRate();
+ if (queryRate == 0 && writeRate == 0) return queryCpuFraction(0.5);
+ return queryCpuFraction(queryRate / (queryRate + writeRate));
}
+ private static double queryCpuFraction(double queryFraction) {
+ double relativeQueryCost = 9; // How much more expensive are queries than writes? TODO: Measure?
+ double writeFraction = 1 - queryFraction;
+ return queryFraction * relativeQueryCost / (queryFraction * relativeQueryCost + writeFraction);
+ }
+
+ public static double idealQueryCpuLoad() { return Resource.cpu.idealAverageLoad(); }
+
+ public static double idealWriteCpuLoad() { return 0.95; }
+
public static double idealMemoryLoad() { return Resource.memory.idealAverageLoad(); }
public static double idealDiskLoad() { return Resource.disk.idealAverageLoad(); }
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java
index baf7d2dbe15..650bfe761b5 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java
@@ -15,7 +15,6 @@ import com.yahoo.config.provision.SystemName;
import com.yahoo.config.provision.Zone;
import com.yahoo.vespa.hosted.provision.NodeRepository;
import com.yahoo.vespa.hosted.provision.Nodelike;
-import com.yahoo.vespa.hosted.provision.applications.Application;
import com.yahoo.vespa.hosted.provision.provisioning.HostResourcesCalculator;
import org.junit.Test;
@@ -54,6 +53,7 @@ public class AutoscalingTest {
assertTrue("Too few measurements -> No change", tester.autoscale(application1, cluster1.id(), min, max).isEmpty());
tester.clock().advance(Duration.ofDays(1));
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addCpuMeasurements(0.25f, 1f, 120, application1);
ClusterResources scaledResources = tester.assertResources("Scaling up since resource usage is too high",
14, 1, 1.4, 30.8, 30.8,
@@ -93,6 +93,7 @@ public class AutoscalingTest {
// deploy
tester.deploy(application1, cluster1, 5, 1, resources);
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addCpuMeasurements(0.25f, 1f, 120, application1);
ClusterResources scaledResources = tester.assertResources("Scaling up since cpu usage is too high",
@@ -122,6 +123,7 @@ public class AutoscalingTest {
.allMatch(n -> n.allocation().get().requestedResources().diskSpeed() == NodeResources.DiskSpeed.slow);
tester.clock().advance(Duration.ofDays(2));
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addCpuMeasurements(0.25f, 1f, 120, application1);
// Changing min and max from slow to any
ClusterResources min = new ClusterResources( 2, 1,
@@ -181,6 +183,7 @@ public class AutoscalingTest {
// deploy
tester.deploy(application1, cluster1, 5, 1,
new NodeResources(1.9, 70, 70, 1));
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addMeasurements(0.25f, 0.95f, 0.95f, 0, 120, application1);
tester.assertResources("Scaling up to limit since resource usage is too high",
6, 1, 2.4, 78.0, 79.0,
@@ -217,6 +220,7 @@ public class AutoscalingTest {
// deploy
tester.deploy(application1, cluster1, 5, 5, new NodeResources(3.0, 10, 10, 1));
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addCpuMeasurements( 0.3f, 1f, 240, application1);
tester.assertResources("Scaling up since resource usage is too high",
6, 6, 3.6, 8.0, 10.0,
@@ -252,6 +256,7 @@ public class AutoscalingTest {
// deploy
tester.deploy(application1, cluster1, 5, 1, resources);
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addCpuMeasurements(0.25f, 1f, 120, application1);
tester.assertResources("Scaling up since resource usage is too high",
7, 1, 2.5, 80.0, 80.0,
@@ -304,6 +309,7 @@ public class AutoscalingTest {
// deploy
tester.deploy(application1, cluster1, 5, 5, resources);
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addCpuMeasurements(0.25f, 1f, 120, application1);
tester.assertResources("Scaling up since resource usage is too high",
7, 7, 2.5, 80.0, 80.0,
@@ -322,6 +328,7 @@ public class AutoscalingTest {
// deploy
tester.deploy(application1, cluster1, 6, 2, resources);
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addCpuMeasurements(0.25f, 1f, 120, application1);
tester.assertResources("Scaling up since resource usage is too high, changing to 1 group is cheaper",
8, 1, 2.7, 83.3, 83.3,
@@ -341,6 +348,7 @@ public class AutoscalingTest {
// deploy
tester.deploy(application1, cluster1, 6, 2, new NodeResources(10, 100, 100, 1));
tester.clock().advance(Duration.ofDays(1));
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addMemMeasurements(1.0f, 1f, 1000, application1);
tester.assertResources("Increase group size to reduce memory load",
8, 2, 13.6, 89.3, 62.5,
@@ -360,6 +368,7 @@ public class AutoscalingTest {
// deploy
tester.deploy(application1, cluster1, 6, 1, hostResources.withVcpu(hostResources.vcpu() / 2));
tester.clock().advance(Duration.ofDays(2));
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addMemMeasurements(0.02f, 0.95f, 120, application1);
tester.assertResources("Scaling down",
6, 1, 2.9, 4.0, 95.0,
@@ -377,6 +386,7 @@ public class AutoscalingTest {
ClusterSpec cluster1 = tester.clusterSpec(ClusterSpec.Type.content, "cluster1");
tester.deploy(application1, cluster1, 6, 1, hostResources.withVcpu(hostResources.vcpu() / 2));
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
// No autoscaling as it is too soon to scale down after initial deploy (counting as a scaling event)
tester.addMemMeasurements(0.02f, 0.95f, 120, application1);
@@ -391,7 +401,7 @@ public class AutoscalingTest {
}
@Test
- public void real_resources_are_taken_into_account() {
+ public void test_autoscaling_considers_real_resources() {
NodeResources hostResources = new NodeResources(60, 100, 1000, 10);
ClusterResources min = new ClusterResources(2, 1, new NodeResources( 2, 20, 200, 1));
ClusterResources max = new ClusterResources(4, 1, new NodeResources(60, 100, 1000, 1));
@@ -403,6 +413,7 @@ public class AutoscalingTest {
ClusterSpec cluster1 = tester.clusterSpec(ClusterSpec.Type.content, "cluster1");
tester.deploy(application1, cluster1, min);
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addMeasurements(1.0f, 1.0f, 0.7f, 0, 1000, application1);
tester.assertResources("Scaling up",
4, 1, 7.4, 20, 200,
@@ -416,6 +427,7 @@ public class AutoscalingTest {
ClusterSpec cluster1 = tester.clusterSpec(ClusterSpec.Type.content, "cluster1");
tester.deploy(application1, cluster1, min);
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addMeasurements(1.0f, 1.0f, 0.7f, 0, 1000, application1);
tester.assertResources("Scaling up",
4, 1, 7.4, 34, 200,
@@ -455,6 +467,7 @@ public class AutoscalingTest {
tester.deactivateRetired(application1, cluster1, scaledResources);
tester.clock().advance(Duration.ofDays(2));
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addMemMeasurements(0.3f, 0.6f, 1000, application1);
tester.assertResources("Scaling down since resource usage has gone down",
6, 1, 3, 83, 28.8,
@@ -472,6 +485,7 @@ public class AutoscalingTest {
ClusterSpec cluster1 = tester.clusterSpec(ClusterSpec.Type.container, "cluster1");
tester.deploy(application1, cluster1, 5, 1, resources);
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addCpuMeasurements(0.25f, 1f, 120, application1);
// (no read share stored)
@@ -502,6 +516,7 @@ public class AutoscalingTest {
ClusterSpec cluster1 = tester.clusterSpec(ClusterSpec.Type.container, "cluster1");
tester.deploy(application1, cluster1, 5, 1, resources);
+ tester.addQueryRateMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0); // Query traffic only
tester.addCpuMeasurements(0.25f, 1f, 120, application1);
// (no query rate data)
@@ -529,6 +544,50 @@ public class AutoscalingTest {
}
@Test
+ public void test_autoscaling_considers_query_vs_write_rate() {
+ NodeResources minResources = new NodeResources( 1, 100, 100, 1);
+ NodeResources midResources = new NodeResources( 5, 100, 100, 1);
+ NodeResources maxResources = new NodeResources(10, 100, 100, 1);
+ ClusterResources min = new ClusterResources(5, 1, minResources);
+ ClusterResources max = new ClusterResources(5, 1, maxResources);
+ AutoscalingTester tester = new AutoscalingTester(maxResources.withVcpu(maxResources.vcpu() * 2));
+
+ ApplicationId application1 = tester.applicationId("application1");
+ ClusterSpec cluster1 = tester.clusterSpec(ClusterSpec.Type.container, "cluster1");
+
+ tester.deploy(application1, cluster1, 5, 1, midResources);
+ tester.addCpuMeasurements(0.4f, 1f, 120, application1);
+
+ // Why twice the query rate at time = 0?
+ // This makes headroom for queries doubling, which we want to observe the effect of here
+
+ tester.addLoadMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0, t -> 10.0);
+ tester.assertResources("Query and write load is equal -> scale up somewhat",
+ 5, 1, 7.3, 100, 100,
+ tester.autoscale(application1, cluster1.id(), min, max).target());
+
+ tester.addLoadMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 100.0 : 50.0, t -> 10.0);
+ tester.assertResources("Query load is 5x write load -> scale up more",
+ 5, 1, 9.7, 100, 100,
+ tester.autoscale(application1, cluster1.id(), min, max).target());
+
+ tester.addLoadMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0, t -> 100.0);
+ tester.assertResources("Write load is 10x query load -> scale down",
+ 5, 1, 3.8, 100, 100,
+ tester.autoscale(application1, cluster1.id(), min, max).target());
+
+ tester.addLoadMeasurements(application1, cluster1.id(), 10, t -> t == 0 ? 20.0 : 10.0, t-> 0.0);
+ tester.assertResources("Query only -> largest possible",
+ 5, 1, 10.0, 100, 100,
+ tester.autoscale(application1, cluster1.id(), min, max).target());
+
+ tester.addLoadMeasurements(application1, cluster1.id(), 10, t -> 0.0, t -> 10.0);
+ tester.assertResources("Write only -> smallest possible",
+ 5, 1, 2.1, 100, 100,
+ tester.autoscale(application1, cluster1.id(), min, max).target());
+ }
+
+ @Test
public void test_cd_autoscaling_test() {
NodeResources resources = new NodeResources(1, 4, 50, 1);
ClusterResources min = new ClusterResources( 2, 1, resources);
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTester.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTester.java
index 1949a6116d8..e24146d4752 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTester.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTester.java
@@ -236,6 +236,19 @@ class AutoscalingTester {
}
/** Creates the given number of measurements, spaced 5 minutes between, using the given function */
+ public void addLoadMeasurements(ApplicationId application,
+ ClusterSpec.Id cluster,
+ int measurements,
+ IntFunction<Double> queryRate,
+ IntFunction<Double> writeRate) {
+ Instant time = clock().instant();
+ for (int i = 0; i < measurements; i++) {
+ db.addClusterMetrics(application, Map.of(cluster, new ClusterMetricSnapshot(time, queryRate.apply(i), writeRate.apply(i))));
+ time = time.plus(Duration.ofMinutes(5));
+ }
+ }
+
+ /** Creates the given number of measurements, spaced 5 minutes between, using the given function */
public void addQueryRateMeasurements(ApplicationId application,
ClusterSpec.Id cluster,
int measurements,
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainerTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainerTest.java
index 0c1a59c883d..f292ab8ccf1 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainerTest.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainerTest.java
@@ -152,6 +152,7 @@ public class AutoscalingMaintainerTest {
// deploy
tester.deploy(app1, cluster1, app1Capacity);
+ tester.addQueryRateMeasurements(app1, cluster1.id(), 12, t -> t == 0 ? 20.0 : 10.0);
for (int i = 0; i < 20; i++) {
// Record completion to keep scaling window at minimum
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainerTester.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainerTester.java
index e8cfe6a2310..755f7608cd9 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainerTester.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainerTester.java
@@ -16,6 +16,7 @@ import com.yahoo.vespa.hosted.provision.Node;
import com.yahoo.vespa.hosted.provision.NodeList;
import com.yahoo.vespa.hosted.provision.NodeRepository;
import com.yahoo.vespa.hosted.provision.applications.Cluster;
+import com.yahoo.vespa.hosted.provision.autoscale.ClusterMetricSnapshot;
import com.yahoo.vespa.hosted.provision.autoscale.NodeMetricSnapshot;
import com.yahoo.vespa.hosted.provision.autoscale.MetricsDb;
import com.yahoo.vespa.hosted.provision.provisioning.FlavorConfigBuilder;
@@ -27,6 +28,7 @@ import java.time.Instant;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
+import java.util.function.IntFunction;
import java.util.stream.Collectors;
/**
@@ -85,6 +87,18 @@ public class AutoscalingMaintainerTester {
}
}
+ /** Creates the given number of measurements, spaced 5 minutes between, using the given function */
+ public void addQueryRateMeasurements(ApplicationId application,
+ ClusterSpec.Id cluster,
+ int measurements,
+ IntFunction<Double> queryRate) {
+ Instant time = clock().instant();
+ for (int i = 0; i < measurements; i++) {
+ metricsDb.addClusterMetrics(application, Map.of(cluster, new ClusterMetricSnapshot(time, queryRate.apply(i), 0.0)));
+ time = time.plus(Duration.ofMinutes(5));
+ }
+ }
+
public Cluster cluster(ApplicationId application, ClusterSpec cluster) {
return nodeRepository().applications().get(application).get().cluster(cluster.id()).get();
}
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/ScalingSuggestionsMaintainerTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/ScalingSuggestionsMaintainerTest.java
index 88d39e887d3..9ae67cef235 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/ScalingSuggestionsMaintainerTest.java
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/ScalingSuggestionsMaintainerTest.java
@@ -72,9 +72,9 @@ public class ScalingSuggestionsMaintainerTest {
new TestMetric());
maintainer.maintain();
- assertEquals("14 nodes with [vcpu: 6.9, memory: 5.1 Gb, disk 15.0 Gb, bandwidth: 0.1 Gbps]",
+ assertEquals("12 nodes with [vcpu: 6.0, memory: 5.1 Gb, disk 15.0 Gb, bandwidth: 0.1 Gbps]",
suggestionOf(app1, cluster1, tester).get().resources().toString());
- assertEquals("9 nodes with [vcpu: 13.8, memory: 4.0 Gb, disk 10.3 Gb, bandwidth: 0.1 Gbps]",
+ assertEquals("8 nodes with [vcpu: 11.0, memory: 4.0 Gb, disk 11.8 Gb, bandwidth: 0.1 Gbps]",
suggestionOf(app2, cluster2, tester).get().resources().toString());
// Utilization goes way down
@@ -82,14 +82,14 @@ public class ScalingSuggestionsMaintainerTest {
addMeasurements(0.10f, 0.10f, 0.10f, 0, 500, app1, tester.nodeRepository(), metricsDb);
maintainer.maintain();
assertEquals("Suggestion stays at the peak value observed",
- "14 nodes with [vcpu: 6.9, memory: 5.1 Gb, disk 15.0 Gb, bandwidth: 0.1 Gbps]",
+ "12 nodes with [vcpu: 6.0, memory: 5.1 Gb, disk 15.0 Gb, bandwidth: 0.1 Gbps]",
suggestionOf(app1, cluster1, tester).get().resources().toString());
// Utilization is still way down and a week has passed
tester.clock().advance(Duration.ofDays(7));
addMeasurements(0.10f, 0.10f, 0.10f, 0, 500, app1, tester.nodeRepository(), metricsDb);
maintainer.maintain();
assertEquals("Peak suggestion has been outdated",
- "6 nodes with [vcpu: 2.0, memory: 4.0 Gb, disk 10.0 Gb, bandwidth: 0.1 Gbps]",
+ "5 nodes with [vcpu: 1.8, memory: 4.0 Gb, disk 10.0 Gb, bandwidth: 0.1 Gbps]",
suggestionOf(app1, cluster1, tester).get().resources().toString());
assertTrue(shouldSuggest(app1, cluster1, tester));
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/responses/application1.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/responses/application1.json
index 1e9a2d60837..65e07c46242 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/responses/application1.json
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/responses/application1.json
@@ -66,7 +66,7 @@
},
"utilization" : {
"cpu" : 0.0,
- "idealCpu": 0.2,
+ "idealCpu": 0.275,
"memory" : 0.0,
"idealMemory": 0.7,
"disk" : 0.0,
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/responses/application2.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/responses/application2.json
index 376b748ff8e..ecab55d19d4 100644
--- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/responses/application2.json
+++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/responses/application2.json
@@ -42,7 +42,7 @@
},
"utilization" : {
"cpu" : 0.0,
- "idealCpu": 0.19047619047619047,
+ "idealCpu": 0.2664285714285714,
"memory" : 0.0,
"idealMemory": 0.7,
"disk" : 0.0,