2018-04-27 19:40:24 -05:00
|
|
|
## JVM configuration
|
2018-06-12 14:37:08 -05:00
|
|
|
{% if (not (elasticsearch_node_master | default(master_node)) | bool) and (not (elasticsearch_node_data | default(data_node)) | bool) %}
|
2018-08-08 01:11:51 -05:00
|
|
|
{% set heap_size = (elastic_heap_size_default | int) // 2 %}
|
2018-06-12 14:37:08 -05:00
|
|
|
{% else %}
|
2018-08-08 01:11:51 -05:00
|
|
|
{% set heap_size = (elastic_heap_size_default | int) %}
|
2018-06-12 14:37:08 -05:00
|
|
|
{% endif %}
|
2018-07-24 17:46:15 -05:00
|
|
|
# Xms represents the initial size of total heap space
|
|
|
|
-Xms{{ heap_size }}m
|
|
|
|
# Xmx represents the maximum size of total heap space
|
|
|
|
-Xmx{{ heap_size }}m
|
2018-09-17 21:17:20 -05:00
|
|
|
# Sets the thread stack size
|
|
|
|
-Xss1m
|
2018-04-27 19:40:24 -05:00
|
|
|
|
|
|
|
################################################################
|
|
|
|
## Expert settings
|
|
|
|
################################################################
|
|
|
|
##
|
|
|
|
## All settings below this section are considered
|
|
|
|
## expert settings. Don't tamper with them unless
|
|
|
|
## you understand what you are doing
|
|
|
|
##
|
|
|
|
################################################################
|
|
|
|
|
2018-07-24 17:46:15 -05:00
|
|
|
## GC Configuration
|
2018-09-21 20:06:52 -05:00
|
|
|
{% if ((heap_size | int) > 6144) and (elastic_g1gc_enabled | bool) %}
|
2018-07-24 17:46:15 -05:00
|
|
|
-XX:+UseG1GC
|
|
|
|
-XX:MaxGCPauseMillis=400
|
|
|
|
-XX:InitiatingHeapOccupancyPercent=75
|
|
|
|
{% else %}
|
2018-04-27 19:40:24 -05:00
|
|
|
-XX:+UseParNewGC
|
|
|
|
-XX:+UseConcMarkSweepGC
|
|
|
|
-XX:CMSInitiatingOccupancyFraction=75
|
|
|
|
-XX:+UseCMSInitiatingOccupancyOnly
|
2018-07-24 17:46:15 -05:00
|
|
|
{% endif %}
|
2018-04-27 19:40:24 -05:00
|
|
|
|
|
|
|
## optimizations
|
|
|
|
|
|
|
|
# disable calls to System#gc
|
|
|
|
-XX:+DisableExplicitGC
|
|
|
|
|
|
|
|
## locale
|
|
|
|
# Set the locale language
|
|
|
|
#-Duser.language=en
|
|
|
|
|
|
|
|
# Set the locale country
|
|
|
|
#-Duser.country=US
|
|
|
|
|
|
|
|
# Set the locale variant, if any
|
|
|
|
#-Duser.variant=
|
|
|
|
|
|
|
|
## basic
|
|
|
|
|
|
|
|
# set the I/O temp directory
|
2018-07-16 14:55:14 -05:00
|
|
|
-Djava.io.tmpdir={{ temp_dir }}
|
2018-04-27 19:40:24 -05:00
|
|
|
|
|
|
|
# set to headless, just in case
|
|
|
|
-Djava.awt.headless=true
|
|
|
|
|
|
|
|
# ensure UTF-8 encoding by default (e.g. filenames)
|
|
|
|
-Dfile.encoding=UTF-8
|
|
|
|
|
|
|
|
# use our provided JNA always versus the system one
|
|
|
|
#-Djna.nosys=true
|
|
|
|
|
|
|
|
## 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=${LOGSTASH_HOME}/heapdump.hprof
|
|
|
|
|
|
|
|
## GC logging
|
|
|
|
#-XX:+PrintGCDetails
|
|
|
|
#-XX:+PrintGCTimeStamps
|
|
|
|
#-XX:+PrintGCDateStamps
|
|
|
|
#-XX:+PrintClassHistogram
|
|
|
|
#-XX:+PrintTenuringDistribution
|
|
|
|
#-XX:+PrintGCApplicationStoppedTime
|
|
|
|
|
|
|
|
# log GC status to a file with time stamps
|
|
|
|
# ensure the directory exists
|
|
|
|
#-Xloggc:${LS_GC_LOG_FILE}
|
2018-06-12 14:37:08 -05:00
|
|
|
|
2018-09-05 10:45:23 +00:00
|
|
|
#listen on IPv4 addresses
|
|
|
|
-Djava.net.preferIPv4Stack=true
|
|
|
|
|
2018-06-12 14:37:08 -05:00
|
|
|
# Disable log4j because its not supported by elastic
|
|
|
|
-Dlog4j2.disable.jmx=true
|