-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hybrid (G1) GC uses the defeault 200ms MaxGCPauseMillis on JDK-21+ #1706
base: develop
Are you sure you want to change the base?
Conversation
It seems that the heuristics have gone a bit sideways in JDK-21 causing degenerate full gc pauses unnecessarily when we configure `-XX:MaxGCPauseMillis=500`, however setting the default 200ms value resolves this behavior. Note that we deployed the increase from 200ms to 500ms at a time when container cpu shares informed the JDKs processor count, thus gc threads/etc, which is no longer the case. As such, it should be safe (and generally more stable) to use the hardened default values from the jdk.
Generate changelog in
|
return ImmutableList.of("-XX:+UseG1GC", "-XX:+UseNUMA", "-XX:MaxGCPauseMillis=" + maxGCPauseMillis); | ||
public final List<String> gcJvmOpts(JavaVersion javaVersion) { | ||
return ImmutableList.of( | ||
"-XX:+UseG1GC", "-XX:+UseNUMA", "-XX:MaxGCPauseMillis=" + getMaxGCPauseMillis(javaVersion)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it would be best to exclude this parameter entirely when it's not specified? That way if the default changes in the jdk, we follow it. I don't have a strong preference -- we could update this once we drop support for jdk17 to exclude the value unless specified.
It seems that the heuristics have gone a bit sideways in JDK-21 causing degenerate full gc pauses unnecessarily when we configure
-XX:MaxGCPauseMillis=500
, however setting the default 200ms value resolves this behavior.Note that we deployed the increase from 200ms to 500ms at a time when container cpu shares informed the JDKs processor count, thus gc threads/etc, which is no longer the case. As such, it should be safe (and generally more stable) to use the hardened default values from the jdk.
==COMMIT_MSG==
Hybrid (G1) GC uses the defeault 200ms MaxGCPauseMillis on JDK-21+
==COMMIT_MSG==
Possible downsides?
Performance could change in unexpected ways!
Alternatives:
We could change the default across the board, however it's a bit safer to apply this more precisely to the java version where our previous default value causes problems.
We could slowly ratchet the value down over time, however that makes it more difficult to root cause changes, as they would be less abrupt. We're currently rolling this out explicitly (via the configuration dsl) in a subset of services of varying sizes to validate that metrics look the same or better before rolling this out.