I have a 5 node cluster with hardware as 16 cores & 120 Gb of Ram.Which JVM garbage collector should be used for Apache Cassandra 3.11.3 version production cluster.
Bringing together the Apache Cassandra experts from the community and DataStax.
Want to learn? Have a question? Want to share your expertise? You are in the right place!
Not sure where to begin? Getting Started
I have a 5 node cluster with hardware as 16 cores & 120 Gb of Ram.Which JVM garbage collector should be used for Apache Cassandra 3.11.3 version production cluster.
By default, Cassandra 3.11 uses CMS (ConcurrentMarkSweep garbage collector). We recommend it for heap sizes up to 24GB. For very low production workloads, we recommend allocating 8GB to the heap as a minimum. For moderate workloads, allocate at least 16GB. I would go as high as 20GB, maybe 24GB max on CMS.
For heap sizes larger than 20GB we find that G1 GC (garbage-first collector) performs better. Of course, YMMV.
Go as high as 31GB with G1 GC. Otherwise, you'll find that heap sizes larger than 32GB has less addressable objects on 64-bit machines compared to 31GB. Fabian Lange has a nice explanation about this in his blog post Why 35GB Heap is Less Than 32GB – Java JVM Memory Oddities.
In any case, I think there are limited use cases where very large heap sizes are suitable, at least in my experience. You get diminishing returns with large heaps for pure-Cassandra workloads and in my opinion, you are better off having more nodes in your cluster compared to fewer nodes with large RAMs. Cheers!
Yes, you can change the garbage collector even for existing nodes/clusters.
As always, make sure you test, test and test. Cheers!
6 People are following this question.
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2022 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use