github.com/qsunny/k8s@v0.0.0-20220101153623-e6dca256d5bf/examples-master/cassandra/image/files/jvm.options (about) 1 ########################################################################### 2 # jvm.options # 3 # # 4 # - all flags defined here will be used by cassandra to startup the JVM # 5 # - one flag should be specified per line # 6 # - lines that do not start with '-' will be ignored # 7 # - only static flags are accepted (no variables or parameters) # 8 # - dynamic flags will be appended to these on cassandra-env # 9 ########################################################################### 10 11 ###################### 12 # STARTUP PARAMETERS # 13 ###################### 14 15 # Uncomment any of the following properties to enable specific startup parameters 16 17 # In a multi-instance deployment, multiple Cassandra instances will independently assume that all 18 # CPU processors are available to it. This setting allows you to specify a smaller set of processors 19 # and perhaps have affinity. 20 #-Dcassandra.available_processors=number_of_processors 21 22 # The directory location of the cassandra.yaml file. 23 #-Dcassandra.config=directory 24 25 # Sets the initial partitioner token for a node the first time the node is started. 26 #-Dcassandra.initial_token=token 27 28 # Set to false to start Cassandra on a node but not have the node join the cluster. 29 #-Dcassandra.join_ring=true|false 30 31 # Set to false to clear all gossip state for the node on restart. Use when you have changed node 32 # information in cassandra.yaml (such as listen_address). 33 #-Dcassandra.load_ring_state=true|false 34 35 # Enable pluggable metrics reporter. See Pluggable metrics reporting in Cassandra 2.0.2. 36 #-Dcassandra.metricsReporterConfigFile=file 37 38 # Set the port on which the CQL native transport listens for clients. (Default: 9042) 39 #-Dcassandra.native_transport_port=port 40 41 # Overrides the partitioner. (Default: org.apache.cassandra.dht.Murmur3Partitioner) 42 #-Dcassandra.partitioner=partitioner 43 44 # To replace a node that has died, restart a new node in its place specifying the address of the 45 # dead node. The new node must not have any data in its data directory, that is, it must be in the 46 # same state as before bootstrapping. 47 #-Dcassandra.replace_address=listen_address or broadcast_address of dead node 48 49 # Allow restoring specific tables from an archived commit log. 50 #-Dcassandra.replayList=table 51 52 # Allows overriding of the default RING_DELAY (1000ms), which is the amount of time a node waits 53 # before joining the ring. 54 #-Dcassandra.ring_delay_ms=ms 55 56 # Set the port for the Thrift RPC service, which is used for client connections. (Default: 9160) 57 #-Dcassandra.rpc_port=port 58 59 # Set the SSL port for encrypted communication. (Default: 7001) 60 #-Dcassandra.ssl_storage_port=port 61 62 # Enable or disable the native transport server. See start_native_transport in cassandra.yaml. 63 # cassandra.start_native_transport=true|false 64 65 # Enable or disable the Thrift RPC server. (Default: true) 66 #-Dcassandra.start_rpc=true/false 67 68 # Set the port for inter-node communication. (Default: 7000) 69 #-Dcassandra.storage_port=port 70 71 # Set the default location for the trigger JARs. (Default: conf/triggers) 72 #-Dcassandra.triggers_dir=directory 73 74 # For testing new compaction and compression strategies. It allows you to experiment with different 75 # strategies and benchmark write performance differences without affecting the production workload. 76 #-Dcassandra.write_survey=true 77 78 # To disable configuration via JMX of auth caches (such as those for credentials, permissions and 79 # roles). This will mean those config options can only be set (persistently) in cassandra.yaml 80 # and will require a restart for new values to take effect. 81 #-Dcassandra.disable_auth_caches_remote_configuration=true 82 83 ######################## 84 # GENERAL JVM SETTINGS # 85 ######################## 86 87 # enable assertions. disabling this in production will give a modest 88 # performance benefit (around 5%). 89 -ea 90 91 # enable thread priorities, primarily so we can give periodic tasks 92 # a lower priority to avoid interfering with client workload 93 -XX:+UseThreadPriorities 94 95 # allows lowering thread priority without being root on linux - probably 96 # not necessary on Windows but doesn't harm anything. 97 # see http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workar 98 -XX:ThreadPriorityPolicy=42 99 100 # Enable heap-dump if there's an OOM 101 -XX:+HeapDumpOnOutOfMemoryError 102 103 # Per-thread stack size. 104 -Xss256k 105 106 # Larger interned string table, for gossip's benefit (CASSANDRA-6410) 107 -XX:StringTableSize=1000003 108 109 # Make sure all memory is faulted and zeroed on startup. 110 # This helps prevent soft faults in containers and makes 111 # transparent hugepage allocation more effective. 112 -XX:+AlwaysPreTouch 113 114 # Disable biased locking as it does not benefit Cassandra. 115 -XX:-UseBiasedLocking 116 117 # Enable thread-local allocation blocks and allow the JVM to automatically 118 # resize them at runtime. 119 -XX:+UseTLAB 120 -XX:+ResizeTLAB 121 122 # http://www.evanjones.ca/jvm-mmap-pause.html 123 -XX:+PerfDisableSharedMem 124 125 # Prefer binding to IPv4 network intefaces (when net.ipv6.bindv6only=1). See 126 # https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6342561 (short version: 127 # comment out this entry to enable IPv6 support). 128 -Djava.net.preferIPv4Stack=true 129 130 ### Debug options 131 132 # uncomment to enable flight recorder 133 #-XX:+UnlockCommercialFeatures 134 #-XX:+FlightRecorder 135 136 # uncomment to have Cassandra JVM listen for remote debuggers/profilers on port 1414 137 #-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1414 138 139 # uncomment to have Cassandra JVM log internal method compilation (developers only) 140 #-XX:+UnlockDiagnosticVMOptions 141 #-XX:+LogCompilation 142 143 ################# 144 # HEAP SETTINGS # 145 ################# 146 147 # Heap size is automatically calculated by cassandra-env based on this 148 # formula: max(min(1/2 ram, 1024MB), min(1/4 ram, 8GB)) 149 # That is: 150 # - calculate 1/2 ram and cap to 1024MB 151 # - calculate 1/4 ram and cap to 8192MB 152 # - pick the max 153 # 154 # For production use you may wish to adjust this for your environment. 155 # If that's the case, uncomment the -Xmx and Xms options below to override the 156 # automatic calculation of JVM heap memory. 157 # 158 # It is recommended to set min (-Xms) and max (-Xmx) heap sizes to 159 # the same value to avoid stop-the-world GC pauses during resize, and 160 # so that we can lock the heap in memory on startup to prevent any 161 # of it from being swapped out. 162 #-Xms4G 163 #-Xmx4G 164 165 # Young generation size is automatically calculated by cassandra-env 166 # based on this formula: min(100 * num_cores, 1/4 * heap size) 167 # 168 # The main trade-off for the young generation is that the larger it 169 # is, the longer GC pause times will be. The shorter it is, the more 170 # expensive GC will be (usually). 171 # 172 # It is not recommended to set the young generation size if using the 173 # G1 GC, since that will override the target pause-time goal. 174 # More info: http://www.oracle.com/technetwork/articles/java/g1gc-1984535.html 175 # 176 # The example below assumes a modern 8-core+ machine for decent 177 # times. If in doubt, and if you do not particularly want to tweak, go 178 # 100 MB per physical CPU core. 179 #-Xmn800M 180 181 ################# 182 # GC SETTINGS # 183 ################# 184 185 ### CMS Settings 186 187 #-XX:+UseParNewGC 188 #-XX:+UseConcMarkSweepGC 189 #-XX:+CMSParallelRemarkEnabled 190 #-XX:SurvivorRatio=8 191 #-XX:MaxTenuringThreshold=1 192 #-XX:CMSInitiatingOccupancyFraction=75 193 #-XX:+UseCMSInitiatingOccupancyOnly 194 #-XX:CMSWaitDuration=10000 195 #-XX:+CMSParallelInitialMarkEnabled 196 #-XX:+CMSEdenChunksRecordAlways 197 # some JVMs will fill up their heap when accessed via JMX, see CASSANDRA-6541 198 #-XX:+CMSClassUnloadingEnabled 199 200 ### G1 Settings (experimental, comment previous section and uncomment section below to enable) 201 202 ## Use the Hotspot garbage-first collector. 203 -XX:+UseG1GC 204 # 205 ## Have the JVM do less remembered set work during STW, instead 206 ## preferring concurrent GC. Reduces p99.9 latency. 207 -XX:G1RSetUpdatingPauseTimePercent=5 208 # 209 ## Main G1GC tunable: lowering the pause target will lower throughput and vise versa. 210 ## 200ms is the JVM default and lowest viable setting 211 ## 1000ms increases throughput. Keep it smaller than the timeouts in cassandra.yaml. 212 #-XX:MaxGCPauseMillis=500 213 214 ## Optional G1 Settings 215 216 # Save CPU time on large (>= 16GB) heaps by delaying region scanning 217 # until the heap is 70% full. The default in Hotspot 8u40 is 40%. 218 #-XX:InitiatingHeapOccupancyPercent=70 219 220 # For systems with > 8 cores, the default ParallelGCThreads is 5/8 the number of logical cores. 221 # Otherwise equal to the number of cores when 8 or less. 222 # Machines with > 10 cores should try setting these to <= full cores. 223 #-XX:ParallelGCThreads=16 224 # By default, ConcGCThreads is 1/4 of ParallelGCThreads. 225 # Setting both to the same value can reduce STW durations. 226 #-XX:ConcGCThreads=16 227 228 ### GC logging options -- uncomment to enable 229 230 -XX:+PrintGCDetails 231 -XX:+PrintGCDateStamps 232 -XX:+PrintHeapAtGC 233 -XX:+PrintTenuringDistribution 234 -XX:+PrintGCApplicationStoppedTime 235 -XX:+PrintPromotionFailure 236 #-XX:PrintFLSStatistics=1 237 #-Xloggc:/var/log/cassandra/gc.log 238 -XX:+UseGCLogFileRotation 239 -XX:NumberOfGCLogFiles=10 240 -XX:GCLogFileSize=10M