<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
Hi Vivekanand,<br>
<br>
I'm actually currently trying to figure out how much information I
can share around the setup we used. I can summarize what is already
public information from my presentations. <br>
<br>
I'm using Cassandra 4 and JDK 21, with tweaked command-line options
(--add-opens and so) to get it to run properly. I try to do very
minimal JVM/GC tuning apart from setting the heap size and enabling
the use of NUMA and large pages. G1 is using a 31G fixed heap
(-Xmx31g -Xms31g) to be able to make use of compressed oops, while
ZGC is using a 32G fixed heap. The only GC tuning I do is setting a
50ms pause time goal (-XX:MaxGCPauseMillis=50) for one of the G1
runs to see how lowering the pause target affect the performance.<br>
<br>
The testing methodology is running the same scenario with more and
more threads to add more and more pressure to the server instance.
The server is running on its own host and it is a single node setup.
The clients all run on a different machine and we use the
cassandra-stress tool with more and more threads to generate the
load.<br>
<br>
Regarding tuning, one of the big things with ZGC is that you
generally should not have to do any tuning. That said, when using
JDK 21 you need to supply the -XX:+ZGenerational option to enable
the generational mode. In JDK 23 and later the generational mode is
on by default and in JDK 24 ZGC is generational and it can't be
turned off.<br>
<br>
Something to look out for when using ZGC is allocation stalls, those
happen when ZGC can't collect and free up memory fast enough.
Generally if you see allocation stalls, you need to increase the
heap size to give ZGC more head room to complete the GC work in
time. If the stalls happen due to unexpected spikes of allocations
the SoftMaxHeapSize option can be used to set the heap size ZGC
should aim at using, but can go over during spikes of allocations.
For example -Xmx32g -XX:SoftMaxHeapSize=28g, would give ZGC 4g of
"reserved head room" that will only be used when it can't keep up.<br>
<br>
I hope this helps,<br>
StefanJ<br>
<br>
<div class="moz-cite-prefix">On 2025-05-09 07:27, Vivekanand Koya
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CA+WGAt8+7vQMysL6CfwHrA962h1KoYKkwgz8XdpKRB2d5nrYQQ@mail.gmail.com">
<div dir="ltr">
<div>Hello ZGC members,</div>
<div><br>
</div>
<div>I work on the Apache Cassandra team implementing support
for JDK21 in the upcoming Cassandra 5+ release. I need insight
into JVM options providing comparable and perhaps improved
performance compared to G1GC. Some work has been done using
the previous defaults: <a href="https://github.com/apache/cassandra/commit/b15d4d6980e787ab5f3405ca8cb17a9c92a4aa47" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/apache/cassandra/commit/b15d4d6980e787ab5f3405ca8cb17a9c92a4aa47</a>.
Also, can you please provide the testing/benchmarking
methodology used by Stefan Johansson when presenting at
Devoxx.</div>
<div><br>
</div>
<div>Hope to achieve greater outcomes together,</div>
<div>Thanks,</div>
<div>Vivekanand K. </div>
</div>
</blockquote>
<br>
</body>
</html>