It seems the 100x test failed again.
Given rc2 will be out soon, and we don't have sufficient elements to ensure G1 is yet a good default GC for 3.0, I opted to play it safe and revert to our 2.2 CMS settings while making G1 easy to enable.
While looking for a way to make it trivial to enable G1, I noticed that although we're pretty accustomed to cassandra-env.sh, it's not very user-friendly to require users to modify a script to change GC/JVM options (is it a script, or a configuration file?). Furthermore, JVM options are duplicated across cassandra-env.sh and cassandra-env.ps1, so every change to our default JVM options require modifying both files, what could potentially lead to options being updated in one place and not another, etc.
I thought this could be a good opportunity to extract JVM options to its own portable and platform-independent configuration file, where users could easily tune JVM/GC options without having to maintain a copy of a script that could be incompatible between different cassandra versions, etc. While searching for options I found a simple format where you basically have one JVM option per line, which makes it easy to be parsed by both cassandra-env.sh and cassandra-env.ps1. In order not to go out of the scope of this ticket too much, I initially ported only the Heap and GC options, and will move other static GC options in the context of another ticket, if there are no objections.
So, given this jvm.options file, changing GCs is a matter of commenting out the default CMS settings and uncommenting the G1 settings:
### CMS Settings (legacy mode, enabled by default)
### G1 Settings (experimental, comment previous section and uncomment section below to enable)
## Use the Hotspot garbage-first collector.
## Have the JVM do less remembered set work during STW, instead
## preferring concurrent GC. Reduces p99.9 latency.
## Main G1GC tunable: lowering the pause target will lower throughput and vise versa.
## 200ms is the JVM default and lowest viable setting
## 1000ms increases throughput. Keep it smaller than the timeouts in cassandra.yaml.
The full version of the cassandra jvm.options file is available on this gist. I initially adapted only cassandra-env.sh to work with the new file. After the review, if there are no major changes, I will adapt cassandra-env.ps1 to work with the new jvm.options file.
Patch is avaialble for review here.