Changing the Garbage-First MaxGCPauseMillis parameter

A pause occurs when a region of memory is full and the JVM needs to make space to continue. A region can fill up, if the rate data is stored in memory exceeds the rate at which it is removed. When tuning the JVM, try to minimize garbage collection pause, also known as a stop-the-world event. For more details, see Garbage collection pauses.

During a pause, all operations are suspended. Because a pause affects networking, the node can appear as down to other nodes in the cluster. SELECT and INSERT statements wait, which increases read and write latencies. Avoid pauses longer than a second, or multiple pauses within a second.

MaxGCPauseMillis sets the peak pause time expected in the environment. By default, DataStax Enterprise (DSE) sets the maximum to 500 milliseconds (-XX:MaxGCPauseMillis=500). DataStax recommends staying between 500-2000 ms. Set the maximum value to the expected peak pause length (not the target pause length). When adjusting the GC pause, there is always a tradeoff between latency and throughput:

  • Longer pause increases latency and throughput

  • Shorter pause decreases latency and throughput

Setting MaxGCPauseMillis lower than 500 ms to force lower latency collections might not have the intended effect. When this value is set lower, it causes GC to run more aggressively and less efficiently, which can steal cycles without yielding considerable benefit.

Set the value for the -XX:MaxGCPauseMillis parameter in the jvm-server.options file.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, 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. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com