summaryrefslogtreecommitdiffstats
path: root/node-repository
diff options
context:
space:
mode:
Diffstat (limited to 'node-repository')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java16
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/NodeMetricsDb.java1
-rw-r--r--node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/AutoscalingTest.java2
3 files changed, 6 insertions, 13 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java
index 6318e71deb9..4d0c61a4177 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/Autoscaler.java
@@ -20,15 +20,7 @@ import java.util.stream.Collectors;
*/
public class Autoscaler {
- /*
- TODO:
- - Scale group size
- - Consider taking spikes/variance into account
- - Measure observed regulation lag (startup+redistribution) and take it into account when deciding regulation observation window
- - Scale by performance not just load+cost
- */
-
- private static final int minimumMeasurements = 500; // TODO: Per node instead? Also say something about interval?
+ private static final int minimumMeasurementsPerNode = 60; // 1 hour
/** What cost difference factor is worth a reallocation? */
private static final double costDifferenceWorthReallocation = 0.1;
@@ -112,8 +104,10 @@ public class Autoscaler {
resource,
clusterNodes.stream().map(Node::hostname).collect(Collectors.toList()));
- if (window.measurementCount() < minimumMeasurements) return Optional.empty();
- if (window.hostnames() != clusterNodes.size()) return Optional.empty(); // Regulate only when all nodes are measured
+ // Require a total number of measurements scaling with the number of nodes,
+ // but don't require that we have at least that many from every node
+ if (window.measurementCount()/clusterNodes.size() < minimumMeasurementsPerNode) return Optional.empty();
+ if (window.hostnames() != clusterNodes.size()) return Optional.empty();
return Optional.of(window.average());
}
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/NodeMetricsDb.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/NodeMetricsDb.java
index 75bc73df5b0..7fa81f0b78e 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/NodeMetricsDb.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/NodeMetricsDb.java
@@ -22,7 +22,6 @@ import java.util.stream.Collectors;
*/
public class NodeMetricsDb {
- private Logger log = Logger.getLogger(NodeMetricsDb.class.getName());
private static final Duration dbWindow = Duration.ofHours(24);
/** Measurements by key. Each list of measurements is sorted by increasing timestamp */
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 a0a44e4f342..2bcbac828b8 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
@@ -46,7 +46,7 @@ public class AutoscalingTest {
assertTrue("No measurements -> No change", tester.autoscale(application1, cluster1.id(), min, max).isEmpty());
- tester.addMeasurements(Resource.cpu, 0.25f, 1f, 60, application1);
+ tester.addMeasurements(Resource.cpu, 0.25f, 1f, 59, application1);
assertTrue("Too few measurements -> No change", tester.autoscale(application1, cluster1.id(), min, max).isEmpty());
tester.addMeasurements(Resource.cpu, 0.25f, 1f, 60, application1);