diff options
author | Harald Musum <musum@verizonmedia.com> | 2021-11-22 14:12:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-22 14:12:16 +0100 |
commit | b8a4d36a3a505171d7cda36cb78038ed7754a738 (patch) | |
tree | 9aa0f4f204a454089d943582da74374b024ddd47 | |
parent | 8e72772625e0487fb750e9cd9b80a57ed2362940 (diff) |
Revert "Hmusum/use parallelg gc as default in hosted [run-systemtest]"
3 files changed, 16 insertions, 15 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java index f69b08ff300..81dd458570b 100755 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java @@ -114,8 +114,8 @@ public abstract class ContainerCluster<CONTAINER extends Container> public static final String APPLICATION_STATUS_HANDLER_CLASS = "com.yahoo.container.handler.observability.ApplicationStatusHandler"; public static final String BINDINGS_OVERVIEW_HANDLER_CLASS = BindingsOverviewHandler.class.getName(); public static final String LOG_HANDLER_CLASS = com.yahoo.container.handler.LogHandler.class.getName(); + public static final String CMS = "-XX:+UseConcMarkSweepGC -XX:MaxTenuringThreshold=15 -XX:NewRatio=1"; public static final String G1GC = "-XX:+UseG1GC -XX:MaxTenuringThreshold=15"; - public static final String PARALLEL_GC = "-XX:+UseParallelGC -XX:MaxTenuringThreshold=15 -XX:NewRatio=1"; public static final String STATE_HANDLER_CLASS = "com.yahoo.container.jdisc.state.StateHandler"; public static final BindingPattern STATE_HANDLER_BINDING_1 = SystemBindingPattern.fromHttpPath(StateHandler.STATE_API_ROOT); diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java index 319f334ffc2..d65fbba6a5e 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java @@ -8,6 +8,7 @@ import com.yahoo.config.application.api.ApplicationPackage; import com.yahoo.config.application.api.DeployLogger; import com.yahoo.config.application.api.DeploymentInstanceSpec; import com.yahoo.config.application.api.DeploymentSpec; +import com.yahoo.config.application.api.Endpoint; import com.yahoo.config.model.ConfigModelContext; import com.yahoo.config.model.ConfigModelContext.ApplicationType; import com.yahoo.config.model.api.ApplicationClusterEndpoint; @@ -660,15 +661,15 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> { static boolean incompatibleGCOptions(String jvmargs) { Pattern gcAlgorithm = Pattern.compile("-XX:[-+]Use.+GC"); Pattern cmsArgs = Pattern.compile("-XX:[-+]*CMS"); - return (gcAlgorithm.matcher(jvmargs).find() || cmsArgs.matcher(jvmargs).find()); + return (gcAlgorithm.matcher(jvmargs).find() ||cmsArgs.matcher(jvmargs).find()); } - private static String buildJvmGCOptions(DeployState deployState, String jvmGCOptions) { - String options = (jvmGCOptions != null) - ? jvmGCOptions + private static String buildJvmGCOptions(DeployState deployState, String jvmGCOPtions) { + String options = (jvmGCOPtions != null) + ? jvmGCOPtions : deployState.getProperties().jvmGCOptions(); return (options == null || options.isEmpty()) - ? (deployState.isHosted() ? ContainerCluster.PARALLEL_GC : ContainerCluster.G1GC) + ? (deployState.isHosted() ? ContainerCluster.CMS : ContainerCluster.G1GC) : options; } @@ -684,7 +685,7 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> { } else { jvmOptions = nodesElement.getAttribute(VespaDomBuilder.JVMARGS_ATTRIB_NAME); if (incompatibleGCOptions(jvmOptions)) { - deployLogger.logApplicationPackage(WARNING, "You need to move out your GC-related options from deprecated 'jvmargs' to 'jvm-gc-options'"); + deployLogger.logApplicationPackage(WARNING, "You need to move out your GC related options from 'jvmargs' to 'jvm-gc-options'"); cluster.setJvmGCOptions(ContainerCluster.G1GC); } } diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/JvmOptionsTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/JvmOptionsTest.java index 9fda6016969..9fa86d38142 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/JvmOptionsTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/JvmOptionsTest.java @@ -132,14 +132,14 @@ public class JvmOptionsTest extends ContainerModelBuilderTestBase { @Test public void requireThatJvmGCOptionsIsHonoured() throws IOException, SAXException { - verifyJvmGCOptions(false, null, null, ContainerCluster.G1GC); - verifyJvmGCOptions(true, null, null, ContainerCluster.PARALLEL_GC); - verifyJvmGCOptions(true, "", null, ContainerCluster.PARALLEL_GC); - verifyJvmGCOptions(false, "-XX:+UseG1GC", null, "-XX:+UseG1GC"); - verifyJvmGCOptions(true, "-XX:+UseG1GC", null, "-XX:+UseG1GC"); - verifyJvmGCOptions(false, null, "-XX:+UseG1GC", "-XX:+UseG1GC"); - verifyJvmGCOptions(false, "-XX:+UseParallelGC", "-XX:+UseG1GC", "-XX:+UseG1GC"); - verifyJvmGCOptions(false, null, "-XX:+UseParallelGC", "-XX:+UseParallelGC"); + verifyJvmGCOptions(false, null,null, ContainerCluster.G1GC); + verifyJvmGCOptions(true, null,null, ContainerCluster.CMS); + verifyJvmGCOptions(true, "",null, ContainerCluster.CMS); + verifyJvmGCOptions(false, "-XX:+UseConcMarkSweepGC",null, "-XX:+UseConcMarkSweepGC"); + verifyJvmGCOptions(true, "-XX:+UseConcMarkSweepGC",null, "-XX:+UseConcMarkSweepGC"); + verifyJvmGCOptions(false, null,"-XX:+UseG1GC", "-XX:+UseG1GC"); + verifyJvmGCOptions(false, "-XX:+UseConcMarkSweepGC","-XX:+UseG1GC", "-XX:+UseG1GC"); + verifyJvmGCOptions(false, null,"-XX:+UseConcMarkSweepGC", "-XX:+UseConcMarkSweepGC"); } } |