Advertisement
Guest User

JVM Options Cassandra

a guest
May 17th, 2022
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.07 KB | None | 0 0
  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 (30000ms), 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. # To disable dynamic calculation of the page size used when indexing an entire partition (during
  84. # initial index build/rebuild). If set to true, the page size will be fixed to the default of
  85. # 10000 rows per page.
  86. #-Dcassandra.force_default_indexing_page_size=true
  87.  
  88. ########################
  89. # GENERAL JVM SETTINGS #
  90. ########################
  91.  
  92. # enable assertions. highly suggested for correct application functionality.
  93. -ea
  94.  
  95. # enable thread priorities, primarily so we can give periodic tasks
  96. # a lower priority to avoid interfering with client workload
  97. -XX:+UseThreadPriorities
  98.  
  99. # allows lowering thread priority without being root on linux - probably
  100. # not necessary on Windows but doesn't harm anything.
  101. # see http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workar
  102. -XX:ThreadPriorityPolicy=42
  103.  
  104. # Enable heap-dump if there's an OOM
  105. -XX:+HeapDumpOnOutOfMemoryError
  106.  
  107. # Per-thread stack size.
  108. -Xss256k
  109.  
  110. # Larger interned string table, for gossip's benefit (CASSANDRA-6410)
  111. -XX:StringTableSize=1000003
  112.  
  113. # Make sure all memory is faulted and zeroed on startup.
  114. # This helps prevent soft faults in containers and makes
  115. # transparent hugepage allocation more effective.
  116. -XX:+AlwaysPreTouch
  117.  
  118. # Disable biased locking as it does not benefit Cassandra.
  119. -XX:-UseBiasedLocking
  120.  
  121. # Enable thread-local allocation blocks and allow the JVM to automatically
  122. # resize them at runtime.
  123. -XX:+UseTLAB
  124. -XX:+ResizeTLAB
  125. -XX:+UseNUMA
  126.  
  127. # http://www.evanjones.ca/jvm-mmap-pause.html
  128. -XX:+PerfDisableSharedMem
  129.  
  130. # Prefer binding to IPv4 network intefaces (when net.ipv6.bindv6only=1). See
  131. # http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6342561 (short version:
  132. # comment out this entry to enable IPv6 support).
  133. -Djava.net.preferIPv4Stack=true
  134.  
  135. ### Debug options
  136.  
  137. # uncomment to enable flight recorder
  138. #-XX:+UnlockCommercialFeatures
  139. #-XX:+FlightRecorder
  140.  
  141. # uncomment to have Cassandra JVM listen for remote debuggers/profilers on port 1414
  142. #-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1414
  143.  
  144. # uncomment to have Cassandra JVM log internal method compilation (developers only)
  145. #-XX:+UnlockDiagnosticVMOptions
  146. #-XX:+LogCompilation
  147.  
  148. #################
  149. # HEAP SETTINGS #
  150. #################
  151.  
  152. # Heap size is automatically calculated by cassandra-env based on this
  153. # formula: max(min(1/2 ram, 1024MB), min(1/4 ram, 8GB))
  154. # That is:
  155. # - calculate 1/2 ram and cap to 1024MB
  156. # - calculate 1/4 ram and cap to 8192MB
  157. # - pick the max
  158. #
  159. # For production use you may wish to adjust this for your environment.
  160. # If that's the case, uncomment the -Xmx and Xms options below to override the
  161. # automatic calculation of JVM heap memory.
  162. #
  163. # It is recommended to set min (-Xms) and max (-Xmx) heap sizes to
  164. # the same value to avoid stop-the-world GC pauses during resize, and
  165. # so that we can lock the heap in memory on startup to prevent any
  166. # of it from being swapped out.
  167. #-Xms4G
  168. #-Xmx4G
  169.  
  170. # Young generation size is automatically calculated by cassandra-env
  171. # based on this formula: min(100 * num_cores, 1/4 * heap size)
  172. #
  173. # The main trade-off for the young generation is that the larger it
  174. # is, the longer GC pause times will be. The shorter it is, the more
  175. # expensive GC will be (usually).
  176. #
  177. # It is not recommended to set the young generation size if using the
  178. # G1 GC, since that will override the target pause-time goal.
  179. # More info: http://www.oracle.com/technetwork/articles/java/g1gc-1984535.html
  180. #
  181. # The example below assumes a modern 8-core+ machine for decent
  182. # times. If in doubt, and if you do not particularly want to tweak, go
  183. # 100 MB per physical CPU core.
  184. #-Xmn800M
  185.  
  186. ###################################
  187. # EXPIRATION DATE OVERFLOW POLICY #
  188. ###################################
  189.  
  190. # Defines how to handle INSERT requests with TTL exceeding the maximum supported expiration date:
  191. # * REJECT: this is the default policy and will reject any requests with expiration date timestamp after 2038-01-19T03:14:06+00:00.
  192. # * CAP: any insert with TTL expiring after 2038-01-19T03:14:06+00:00 will expire on 2038-01-19T03:14:06+00:00 and the client will receive a warning.
  193. # * CAP_NOWARN: same as previous, except that the client warning will not be emitted.
  194. #
  195. #-Dcassandra.expiration_date_overflow_policy=REJECT
  196.  
  197. #################
  198. # GC SETTINGS #
  199. #################
  200.  
  201. ### CMS Settings
  202.  
  203. -XX:+UseParNewGC
  204. -XX:+UseConcMarkSweepGC
  205. -XX:+CMSParallelRemarkEnabled
  206. -XX:SurvivorRatio=8
  207. -XX:MaxTenuringThreshold=1
  208. -XX:CMSInitiatingOccupancyFraction=75
  209. -XX:+UseCMSInitiatingOccupancyOnly
  210. -XX:CMSWaitDuration=10000
  211. -XX:+CMSParallelInitialMarkEnabled
  212. -XX:+CMSEdenChunksRecordAlways
  213. # some JVMs will fill up their heap when accessed via JMX, see CASSANDRA-6541
  214. -XX:+CMSClassUnloadingEnabled
  215.  
  216. ### G1 Settings (experimental, comment previous section and uncomment section below to enable)
  217.  
  218. ## Use the Hotspot garbage-first collector.
  219. #-XX:+UseG1GC
  220. #
  221. ## Have the JVM do less remembered set work during STW, instead
  222. ## preferring concurrent GC. Reduces p99.9 latency.
  223. #-XX:G1RSetUpdatingPauseTimePercent=5
  224. #
  225. ## Main G1GC tunable: lowering the pause target will lower throughput and vise versa.
  226. ## 200ms is the JVM default and lowest viable setting
  227. ## 1000ms increases throughput. Keep it smaller than the timeouts in cassandra.yaml.
  228. #-XX:MaxGCPauseMillis=500
  229.  
  230. ## Optional G1 Settings
  231.  
  232. # Save CPU time on large (>= 16GB) heaps by delaying region scanning
  233. # until the heap is 70% full. The default in Hotspot 8u40 is 40%.
  234. #-XX:InitiatingHeapOccupancyPercent=70
  235.  
  236. # For systems with > 8 cores, the default ParallelGCThreads is 5/8 the number of logical cores.
  237. # Otherwise equal to the number of cores when 8 or less.
  238. # Machines with > 10 cores should try setting these to <= full cores.
  239. #-XX:ParallelGCThreads=16
  240. # By default, ConcGCThreads is 1/4 of ParallelGCThreads.
  241. # Setting both to the same value can reduce STW durations.
  242. #-XX:ConcGCThreads=16
  243.  
  244. ### GC logging options -- uncomment to enable
  245.  
  246. -XX:+PrintGCDetails
  247. -XX:+PrintGCDateStamps
  248. -XX:+PrintHeapAtGC
  249. -XX:+PrintTenuringDistribution
  250. -XX:+PrintGCApplicationStoppedTime
  251. -XX:+PrintPromotionFailure
  252. #-XX:PrintFLSStatistics=1
  253. #-Xloggc:/var/log/cassandra/gc.log
  254. -XX:+UseGCLogFileRotation
  255. -XX:NumberOfGCLogFiles=10
  256. -XX:GCLogFileSize=10M
  257. -javaagent:/jmx_prometheus_javaagent-0.11.0.jar=8000:/opt/bitnami/cassandra/conf/prometheus.yml
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement