Es cold gc change (#47)

This commit is contained in:
amalgamm 2019-11-14 14:36:46 +03:00 committed by niku64
parent fccded2aa8
commit c3041180a5
2 changed files with 10 additions and 2 deletions

View File

@ -54,6 +54,7 @@ jvm = pillar('elastic:jvm', {})
jvm_heap_size = jvm.get('heap_size', '1g')
jvm_stack_size = jvm.get('stack_size', '1m')
jvm_extra_options = jvm.get('extra_options', {})
jvm_gc_type = jvm.get('gc_type', 'CMS')
jvm_gc_occupancy_value = jvm.get('gc_occupancy_value', '75')
tls = pillar('elastic:tls', {})
@ -127,7 +128,8 @@ File.managed(
mode=644, user='root', group='root',
template='jinja', source='salt://elasticsearch/files/jvm.options.tpl',
defaults={'heap_size': jvm_heap_size, 'stack_size': jvm_stack_size,
'gc_occupancy_value': jvm_gc_occupancy_value, 'extra_options': jvm_extra_options},
'gc_type': jvm_gc_type, 'gc_occupancy_value': jvm_gc_occupancy_value,
'extra_options': jvm_extra_options},
require=[File(conf_path)])
File.managed(

View File

@ -18,10 +18,16 @@
################################################################
## GC configuration
{% if gc_type == 'G1GC' %}
-XX:+UseG1GC
-XX:G1ReservePercent=25
-XX:InitiatingHeapOccupancyPercent={{ gc_occupancy_value }}
-Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=10,filesize=64m
{% else %}
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction={{ gc_occupancy_value }}
-XX:+UseCMSInitiatingOccupancyOnly
{% endif %}
## optimizations
# pre-touch memory pages used by the JVM during initialization