99 lines
3.1 KiB
Plaintext
99 lines
3.1 KiB
Plaintext
## JVM configuration
|
|
|
|
################################################################
|
|
## IMPORTANT: JVM heap size
|
|
################################################################
|
|
##
|
|
## You should always set the min and max JVM heap
|
|
## size to the same value. For example, to set
|
|
## the heap to 4 GB, set:
|
|
##
|
|
## -Xms4g
|
|
## -Xmx4g
|
|
##
|
|
## See https://opensearch.org/docs/opensearch/install/important-settings/
|
|
## for more information
|
|
##
|
|
################################################################
|
|
|
|
# Xms represents the initial size of total heap space
|
|
# Xmx represents the maximum size of total heap space
|
|
|
|
#-Xms1g
|
|
#-Xmx1g
|
|
|
|
################################################################
|
|
## Expert settings
|
|
################################################################
|
|
##
|
|
## All settings below this section are considered
|
|
## expert settings. Don't tamper with them unless
|
|
## you understand what you are doing
|
|
##
|
|
################################################################
|
|
|
|
## GC configuration
|
|
8-10:-XX:+UseConcMarkSweepGC
|
|
8-10:-XX:CMSInitiatingOccupancyFraction=75
|
|
8-10:-XX:+UseCMSInitiatingOccupancyOnly
|
|
|
|
## G1GC Configuration
|
|
# NOTE: G1GC is the default GC for all JDKs 11 and newer
|
|
11-:-XX:+UseG1GC
|
|
# See https://github.com/elastic/elasticsearch/pull/46169 for the history
|
|
# behind these settings, but the tl;dr is that default values can lead
|
|
# to situations where heap usage grows enough to trigger a circuit breaker
|
|
# before GC kicks in.
|
|
11-:-XX:G1ReservePercent=25
|
|
11-:-XX:InitiatingHeapOccupancyPercent=30
|
|
|
|
## JVM temporary directory
|
|
-Djava.io.tmpdir=${OPENSEARCH_TMPDIR}
|
|
|
|
## heap dumps
|
|
|
|
# generate a heap dump when an allocation from the Java heap fails
|
|
# heap dumps are created in the working directory of the JVM
|
|
-XX:+HeapDumpOnOutOfMemoryError
|
|
|
|
# specify an alternative path for heap dumps; ensure the directory exists and
|
|
# has sufficient space
|
|
-XX:HeapDumpPath=/var/lib/opensearch
|
|
|
|
# specify an alternative path for JVM fatal error logs
|
|
-XX:ErrorFile=/var/log/opensearch/hs_err_pid%p.log
|
|
|
|
## JDK 8 GC logging
|
|
8:-XX:+PrintGCDetails
|
|
8:-XX:+PrintGCDateStamps
|
|
8:-XX:+PrintTenuringDistribution
|
|
8:-XX:+PrintGCApplicationStoppedTime
|
|
8:-Xloggc:/var/log/opensearch/gc.log
|
|
8:-XX:+UseGCLogFileRotation
|
|
8:-XX:NumberOfGCLogFiles=32
|
|
8:-XX:GCLogFileSize=64m
|
|
|
|
# JDK 9+ GC logging
|
|
9-:-Xlog:gc*,gc+age=trace,safepoint:file=/var/log/opensearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m
|
|
|
|
# JDK 20+ Incubating Vector Module for SIMD optimizations;
|
|
# disabling may reduce performance on vector optimized lucene
|
|
20-:--add-modules=jdk.incubator.vector
|
|
|
|
# See please https://bugs.openjdk.org/browse/JDK-8341127 (openjdk/jdk#21283)
|
|
23:-XX:CompileCommand=dontinline,java/lang/invoke/MethodHandle.setAsTypeCache
|
|
23:-XX:CompileCommand=dontinline,java/lang/invoke/MethodHandle.asTypeUncached
|
|
|
|
21-:-javaagent:agent/opensearch-agent.jar
|
|
21-:--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED
|
|
|
|
## OpenSearch Performance Analyzer
|
|
-Dclk.tck=100
|
|
-Djdk.attach.allowAttachSelf=true
|
|
-Djava.security.policy=file:///etc/opensearch/opensearch-performance-analyzer/opensearch_security.policy
|
|
--add-opens=jdk.attach/sun.tools.attach=ALL-UNNAMED
|
|
|
|
# Set heap size to 31GB
|
|
-Xms31g
|
|
-Xmx31g
|