summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahooinc.com>2023-09-26 18:34:47 +0200
committerBjørn Christian Seime <bjorncs@yahooinc.com>2023-09-26 18:34:47 +0200
commit8ad897a2ecd3975d4279a792e81402aa96002365 (patch)
tree5f952929a9cdd909096598e5b71a782f349a4187 /config-model
parenta3f1ddde551d7c3092bcbdfb745e4e178da9be0f (diff)
Add debug logging of effective JVM configuration
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/application/validation/JvmHeapSizeValidator.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/JvmHeapSizeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/JvmHeapSizeValidator.java
index 9e231239521..f87cecb58fe 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/JvmHeapSizeValidator.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/JvmHeapSizeValidator.java
@@ -29,21 +29,24 @@ public class JvmHeapSizeValidator extends Validator {
long jvmModelCost = appCluster.onnxModelCost().aggregatedModelCostInBytes();
if (jvmModelCost > 0) {
int percentLimit = 15;
+ double gbLimit = 0.6;
+ double availableMemoryGb = mp.availableMemoryGb().getAsDouble();
+ double modelCostGb = jvmModelCost / (1024D * 1024 * 1024);
+ ds.getDeployLogger().log(Level.FINE, () -> "JVM: %d%% (limit: %d%%), %.2fGB (limit: %.2fGB), ONNX: %.2fGB"
+ .formatted(mp.percentage(), percentLimit, availableMemoryGb, gbLimit, modelCostGb));
if (mp.percentage() < percentLimit) {
throw new IllegalArgumentException(
("Allocated percentage of memory of JVM in cluster '%s' is too low (%d%% < %d%%). " +
"Estimated cost of ONNX models is %.2fGB. Either use a node flavor with more memory or use less expensive models. " +
"You may override this validation by specifying 'allocated-memory' (https://docs.vespa.ai/en/performance/container-tuning.html#jvm-heap-size).")
- .formatted(clusterId, mp.percentage(), percentLimit, jvmModelCost / (1024D * 1024 * 1024)));
+ .formatted(clusterId, mp.percentage(), percentLimit, modelCostGb));
}
- double gbLimit = 0.6;
- double availableMemoryGb = mp.availableMemoryGb().getAsDouble();
if (availableMemoryGb < gbLimit) {
throw new IllegalArgumentException(
("Allocated memory to JVM in cluster '%s' is too low (%.2fGB < %.2fGB). " +
"Estimated cost of ONNX models is %.2fGB. Either use a node flavor with more memory or use less expensive models. " +
"You may override this validation by specifying 'allocated-memory' (https://docs.vespa.ai/en/performance/container-tuning.html#jvm-heap-size).")
- .formatted(clusterId, availableMemoryGb, gbLimit, jvmModelCost / (1024D * 1024 * 1024)));
+ .formatted(clusterId, availableMemoryGb, gbLimit, modelCostGb));
}
}
});