Created
October 7, 2015 17:25
-
-
Save pauloricardomg/cd66c2d299ff25d7b3fa to your computer and use it in GitHub Desktop.
Cassandra jvm.options proposal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################################### | |
# jvm.options # | |
# # | |
# - all flags defined here will be used by cassandra to startup the JVM # | |
# - one flag should be specified per line # | |
# - lines that do not start with '-' will be ignored # | |
# - only static flags are accepted (no variables or parameters) # | |
# - dynamic flags will be appended to these on cassandra-env # | |
########################################################################### | |
################# | |
# HEAP SETTINGS # | |
################# | |
# Heap size is automatically calculated by cassandra-env based on this | |
# formula: max(min(1/2 ram, 1024MB), min(1/4 ram, 8GB)) | |
# That is: | |
# - calculate 1/2 ram and cap to 1024MB | |
# - calculate 1/4 ram and cap to 8192MB | |
# - pick the max | |
# | |
# For production use you may wish to adjust this for your environment. | |
# If that's the case, uncomment the -Xmx and Xms options below to override the | |
# automatic calculation of JVM heap memory. | |
# | |
# It is recommended to set min (-Xms) and max (-Xmx) heap sizes to | |
# the same value to avoid stop-the-world GC pauses during resize, and | |
# so that we can lock the heap in memory on startup to prevent any | |
# of it from being swapped out. | |
#-Xms4G | |
#-Xmx4G | |
# Young generation size is automatically calculated by cassandra-env | |
# based on this formula: min(100 * num_cores, 1/4 * heap size) | |
# | |
# The main trade-off for the young generation is that the larger it | |
# is, the longer GC pause times will be. The shorter it is, the more | |
# expensive GC will be (usually). | |
# | |
# It is not recommended to set the young generation size if using the | |
# G1 GC, since that will override the target pause-time goal. | |
# More info: http://www.oracle.com/technetwork/articles/java/g1gc-1984535.html | |
# | |
# The example below assumes a modern 8-core+ machine for decent | |
# times. If in doubt, and if you do not particularly want to tweak, go | |
# 100 MB per physical CPU core. | |
#-Xmn800M | |
################# | |
# GC SETTINGS # | |
################# | |
### CMS Settings (legacy mode, enabled by default) | |
-XX:+UseParNewGC | |
-XX:+UseConcMarkSweepGC | |
-XX:+CMSParallelRemarkEnabled | |
-XX:SurvivorRatio=8 | |
-XX:MaxTenuringThreshold=1 | |
-XX:CMSInitiatingOccupancyFraction=75 | |
-XX:+UseCMSInitiatingOccupancyOnly | |
-XX:CMSWaitDuration=10000 | |
-XX:+CMSParallelInitialMarkEnabled | |
-XX:+CMSEdenChunksRecordAlways | |
### G1 Settings (experimental, comment previous section and uncomment section below to enable) | |
## Use the Hotspot garbage-first collector. | |
#-XX:+UseG1GC | |
# | |
## Have the JVM do less remembered set work during STW, instead | |
## preferring concurrent GC. Reduces p99.9 latency. | |
#-XX:G1RSetUpdatingPauseTimePercent=5 | |
# | |
## 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. | |
#-XX:MaxGCPauseMillis=500 | |
## Optional G1 Settings | |
# Save CPU time on large (>= 16GB) heaps by delaying region scanning | |
# until the heap is 70% full. The default in Hotspot 8u40 is 40%. | |
#-XX:InitiatingHeapOccupancyPercent=70 | |
# The JVM maximum is 8 PGC threads and 1/4 of that for ConcGC. | |
# Machines with > 10 cores may need additional threads. Increase to <= full cores. | |
#-XX:ParallelGCThreads=16 | |
#-XX:ConcGCThreads=16 | |
### GC logging options -- uncomment to enable | |
# JVM_OPTS="$JVM_OPTS -XX:+PrintGCDetails" | |
# JVM_OPTS="$JVM_OPTS -XX:+PrintGCDateStamps" | |
# JVM_OPTS="$JVM_OPTS -XX:+PrintHeapAtGC" | |
# JVM_OPTS="$JVM_OPTS -XX:+PrintTenuringDistribution" | |
# JVM_OPTS="$JVM_OPTS -XX:+PrintGCApplicationStoppedTime" | |
# JVM_OPTS="$JVM_OPTS -XX:+PrintPromotionFailure" | |
# JVM_OPTS="$JVM_OPTS -XX:PrintFLSStatistics=1" | |
# JVM_OPTS="$JVM_OPTS -Xloggc:/var/log/cassandra/gc.log" | |
# JVM_OPTS="$JVM_OPTS -XX:+UseGCLogFileRotation" | |
# JVM_OPTS="$JVM_OPTS -XX:NumberOfGCLogFiles=10" | |
# JVM_OPTS="$JVM_OPTS -XX:GCLogFileSize=10M" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment