Skip to content

Conversation

@dakrone
Copy link
Member

@dakrone dakrone commented Sep 13, 2018

These options are available now that we will be supporting G1GC for Java 10 and
above. They are also designed so that the CMS options don't have to be commented
out in order for the G1 options to take effect.

These options are available now that we will be supporting G1GC for Java 10 and
above. They are also designed so that the CMS options don't have to be commented
out in order for the G1 options to take effect.
@dakrone dakrone added :Core/Infra/Core Core issues without another label v7.0.0 v6.5.0 labels Sep 13, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@dakrone
Copy link
Member Author

dakrone commented Sep 13, 2018

The benchmarks and results are available at https://writequit.org/org/es/g1gc-testing.html

-XX:+UseCMSInitiatingOccupancyOnly

## G1GC Configuration
# NOTE: We only support G1GC on JDK version 10 or later.
Copy link
Contributor

@dliappis dliappis Sep 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me this reads as, the only GC supported on JDK>=10 is G1GC (e.g. CMS not supported). Then next line reads, to "use G1GC uncomment the lines below".

Would it be better to rephrase as:

G1GC is only supported on JDK version 10 or later.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I've made that change, thanks!

Copy link
Member

@danielmitterdorfer danielmitterdorfer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scenarios tested:

  • JDK: 10
  • elasticsearch.yml: network.host: 0.0.0.0 (to enforce bootstrap checks)
  • jvm.options: Uncomment the G1GC-specific lines

Result:

The node starts up successfully but upon startup we see two warnings:

Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

The node also uses G1GC as can be seen from the gc log:

[2018-09-21T07:38:33.305+0000][24301][gc     ] Using G1

Same behavior with JDK 11 (build 11+28).

  • JDK: 9
  • elasticsearch.yml: network.host: 0.0.0.0 (to enforce bootstrap checks)
  • jvm.options: Uncomment the G1GC-specific lines

Result:

TThe node starts up successfully with one (expected) warning:

Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

and is using the CMS collector:

[2018-09-21T07:48:41.463+0000][25122][gc] Using Concurrent Mark Sweep

Similar behavior on JDK 8 (except for the deprecation warning of course and the log entries in the GC log look different).

  • JDK: 10
  • elasticsearch.yml: network.host: 0.0.0.0 (to enforce bootstrap checks)
  • jvm.options: Keep out-of-the-box default

Result:

The node starts up successfully with one (expected) warning:

Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

and is using the CMS collector:

[2018-09-21T07:41:01.880+0000][24439][gc] Using Concurrent Mark Sweep

Same behavior with JDK 11 (build 11+28).

One more observation: Should CMS one day be removed from the JDK, this will fail but given that we cannot predict the future I think this is a pretty good default.

Thanks for all your work that you put into this!

LGTM

@danielmitterdorfer
Copy link
Member

w.r.t.

The node starts up successfully but upon startup we see two warnings:

Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

I forgot to mention that while this might be puzzling to a user, it is understandable that it happens because we specify -XX:+UseConcMarkSweepGC -XX:-UseConcMarkSweepGC when enabling G1.

@dakrone
Copy link
Member Author

dakrone commented Sep 21, 2018

Thanks for taking a look Daniel and Dimitrios

@dakrone dakrone merged commit 9e1757c into elastic:master Sep 21, 2018
dakrone added a commit that referenced this pull request Sep 21, 2018
* Add commented out JVM options for G1GC

These options are available now that we will be supporting G1GC for Java 10 and
above. They are also designed so that the CMS options don't have to be commented
out in order for the G1 options to take effect.

* Update wording
@plokhotnyuk
Copy link

Why not ZGC which will be delivered with JDK 11 release tomorrow?
http://openjdk.java.net/jeps/333

@jasontedor
Copy link
Member

@plokhotnyuk Because it is experimental, and much like filesystems, GC implementations take many years to mature. From our perspective, G1GC did not reach a point of maturity that we were comfortable with until JDK 10 despite being available for many years. This is why we have taken a cautious approach in supporting it, and will only support it on JDK 10 or higher. For a component of a system as fundamental as the GC implementation, it would be reckless of us to support an experimental GC implementation that has not gone through a maturation period.

@plokhotnyuk
Copy link

@jasontedor ZGC (together with Shenandoah: https://builds.shipilev.net/) is an enabler of using ES on contemporary hardware scaled up to terabytes of RAM...

BTW, more than 1 year since 4TB instances are available on AWS:
https://aws.amazon.com/blogs/aws/now-available-ec2-instances-with-4-tb-of-memory/

kcm pushed a commit that referenced this pull request Oct 30, 2018
* Add commented out JVM options for G1GC

These options are available now that we will be supporting G1GC for Java 10 and
above. They are also designed so that the CMS options don't have to be commented
out in order for the G1 options to take effect.

* Update wording
@dakrone dakrone deleted the add-g1gc-for-jdk-10 branch February 4, 2019 14:45
@nktl
Copy link

nktl commented Feb 8, 2019

@jasontedor ZGC (together with Shenandoah: https://builds.shipilev.net/) is an enabler of using ES on contemporary hardware scaled up to terabytes of RAM...

BTW, more than 1 year since 4TB instances are available on AWS:
https://aws.amazon.com/blogs/aws/now-available-ec2-instances-with-4-tb-of-memory/

You can use multi-terabyte heaps on ES with Azul Zing JVM and their pauseless GC already, although the product is not cheap...
ZGC aims to replicate what Azul guys did years ago - hopefully it matures quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants