EBernhardson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/345632 )

Change subject: Align elasticsearch jvm options with upstream
......................................................................

Align elasticsearch jvm options with upstream

Imports the upstream jvm.options file to our template
and applies our own custom config at the end.

Bug: T161830
Change-Id: Ibb6fe355d86d14d0bbf6c7ccae2d9f695b275dfd
---
M modules/elasticsearch/templates/jvm.options.erb
1 file changed, 119 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/32/345632/1

diff --git a/modules/elasticsearch/templates/jvm.options.erb 
b/modules/elasticsearch/templates/jvm.options.erb
index af588b0..e50ccb0 100644
--- a/modules/elasticsearch/templates/jvm.options.erb
+++ b/modules/elasticsearch/templates/jvm.options.erb
@@ -1,8 +1,127 @@
+## 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://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
+## for more information
+##
+################################################################
+
+# Xms represents the initial size of total heap space
+# Xmx represents the maximum size of total heap space
+
 -Xms<%= @heap_memory %>
 -Xmx<%= @heap_memory %>
+
+################################################################
+## 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
+-XX:+UseConcMarkSweepGC
+-XX:CMSInitiatingOccupancyFraction=75
+-XX:+UseCMSInitiatingOccupancyOnly
+
+## optimizations
+
+# disable calls to System#gc
+-XX:+DisableExplicitGC
+
+# pre-touch memory pages used by the JVM during initialization
+-XX:+AlwaysPreTouch
+
+## basic
+
+# force the server VM (remove on 32-bit client JVMs)
+-server
+
+# explicitly set the stack size (reduce to 320k on 32-bit client JVMs)
+-Xss1m
+
+# 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
+
+# use old-style file permissions on JDK9
+-Djdk.io.permissionsUseCanonicalPath=true
+
+# flags to configure Netty
+-Dio.netty.noUnsafe=true
+-Dio.netty.noKeySetOptimization=true
+-Dio.netty.recycler.maxCapacityPerThread=0
+
+# log4j 2
+-Dlog4j.shutdownHookEnabled=false
+-Dlog4j2.disable.jmx=true
+-Dlog4j.skipJansi=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=<%= @data_dir %>
+
+## 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:${loggc}
+
+# Elasticsearch 5.0.0 will throw an exception on unquoted field names in JSON.
+# If documents were already indexed with unquoted fields in a previous version
+# of Elasticsearch, some operations may throw errors.
+#
+# WARNING: This option will be removed in Elasticsearch 6.0.0 and is provided
+# only for migration purposes.
+#-Delasticsearch.json.allow_unquoted_field_names=true
+
+## Custom Wikimedia configuration
+
+# Defines a limit of proportion of time spent in GC before
+# an OutOfMemory error is thrown.  The goal is to bail and
+# restart the server if throughput is suffering due to
+# GC stalls.
+# TODO: Why 70? why not 60 or 80?
 -XX:GCTimeLimit=70
+
+# Defines minimum percentage of free space after a full GC
+# before an OutOfMemoryError is thrown. Typically a full GC
+# should leave > 50% of heap free. If we are down to 10%
+# something is wrong and bailing is a reasonable solution.
 -XX:GCHeapFreeLimit=10
+
+# Custom flags for GC logging.
 <% @gc_log_flags.each do |gc_log_flag| -%>
 <%= gc_log_flag %>
 <% end -%>

-- 
To view, visit https://gerrit.wikimedia.org/r/345632
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb6fe355d86d14d0bbf6c7ccae2d9f695b275dfd
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: EBernhardson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to