Changing the Garbage-First MaxGCPauseMillis parameter

Set the parameters for Garbage-First garbage collector in the jvm.options file.


The location of the jvm.options file depends on the type of installation:
Package installations /etc/dse/cassandra/jvm.options
Tarball installations installation_location/resources/cassandra/conf/jvm.options

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.

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.

MaxGCPauseMillis sets the peak pause time expected in the environment. By default, DataStax Enterprise 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
CAUTION: Setting MaxGCPauseMillis lower than 500 ms to force lower latency collections, may 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.