aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main/java/com/yahoo')
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java8
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java9
2 files changed, 14 insertions, 3 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java
index eb628db6975..3298b627b19 100644
--- a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java
+++ b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java
@@ -12,6 +12,7 @@ import com.yahoo.config.provision.AthenzDomain;
import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.HostName;
import com.yahoo.config.provision.Zone;
+import com.yahoo.vespa.model.container.ApplicationContainerCluster;
import java.net.URI;
import java.security.cert.X509Certificate;
@@ -76,6 +77,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
private int rpc_num_targets = 1;
private int rpc_events_before_wakeup = 1;
private int mbus_network_threads = 1;
+ private int heapSizePercentage = ApplicationContainerCluster.defaultHeapSizePercentageOfTotalNodeMemory;
private Architecture adminClusterNodeResourcesArchitecture = Architecture.getDefault();
private boolean useRestrictedDataPlaneBindings = false;
@@ -127,6 +129,7 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
@Override public int mbusCppRpcNumTargets() { return mbus_cpp_num_targets; }
@Override public int mbusCppEventsBeforeWakeup() { return mbus_cpp_events_before_wakeup; }
@Override public int rpcNumTargets() { return rpc_num_targets; }
+ @Override public int heapSizePercentage() { return heapSizePercentage; }
@Override public int rpcEventsBeforeWakeup() { return rpc_events_before_wakeup; }
@Override public String queryDispatchPolicy() { return queryDispatchPolicy; }
@Override public boolean useTwoPhaseDocumentGc() { return useTwoPhaseDocumentGc; }
@@ -166,6 +169,11 @@ public class TestProperties implements ModelContext.Properties, ModelContext.Fea
return this;
}
+ public TestProperties setHeapSizePercentage(int percentage) {
+ this.heapSizePercentage = percentage;
+ return this;
+ }
+
public TestProperties setAsyncMessageHandlingOnSchedule(boolean value) {
useAsyncMessageHandlingOnSchedule = value;
return this;
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java
index ea135ba9749..5703de4cb18 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ApplicationContainerCluster.java
@@ -76,7 +76,7 @@ public final class ApplicationContainerCluster extends ContainerCluster<Applicat
private static final BindingPattern PROMETHEUS_V1_HANDLER_BINDING_1 = SystemBindingPattern.fromHttpPath(PrometheusV1Handler.V1_PATH);
private static final BindingPattern PROMETHEUS_V1_HANDLER_BINDING_2 = SystemBindingPattern.fromHttpPath(PrometheusV1Handler.V1_PATH + "/*");
- public static final int heapSizePercentageOfTotalNodeMemory = 70;
+ public static final int defaultHeapSizePercentageOfTotalNodeMemory = 70;
public static final int heapSizePercentageOfTotalNodeMemoryWhenCombinedCluster = 18;
private final Set<FileReference> applicationBundles = new LinkedHashSet<>();
@@ -91,6 +91,7 @@ public final class ApplicationContainerCluster extends ContainerCluster<Applicat
private boolean messageBusEnabled = true;
private final int transport_events_before_wakeup;
private final int transport_connections_per_target;
+ private final int heapSizePercentageOfTotalNodeMemory;
private Integer memoryPercentage = null;
@@ -118,6 +119,9 @@ public final class ApplicationContainerCluster extends ContainerCluster<Applicat
addTestrunnerComponentsIfTester(deployState);
transport_connections_per_target = deployState.featureFlags().mbusJavaRpcNumTargets();
transport_events_before_wakeup = deployState.featureFlags().mbusJavaEventsBeforeWakeup();
+ heapSizePercentageOfTotalNodeMemory = deployState.featureFlags().heapSizePercentage() > 0
+ ? Math.min(99, deployState.featureFlags().heapSizePercentage())
+ : defaultHeapSizePercentageOfTotalNodeMemory;
}
@Override
@@ -169,8 +173,7 @@ public final class ApplicationContainerCluster extends ContainerCluster<Applicat
this.modelEvaluation = modelEvaluation;
}
- public void setMemoryPercentage(Integer memoryPercentage) { this.memoryPercentage = memoryPercentage;
- }
+ public void setMemoryPercentage(Integer memoryPercentage) { this.memoryPercentage = memoryPercentage; }
@Override
public Optional<Integer> getMemoryPercentage() {