Kaynağa Gözat

Simplify JVM options

This commit simplifies the default JVM options that ship with
Elasticsearch. In particular, expert settings that were previously
configurable via environment variables have been removed from the
default configuration file. Further, the heap size settings have been
moved to the top of the file with a clearer message that is in
concordance with their importance.

Closes #17714
Jason Tedor 9 yıl önce
ebeveyn
işleme
7297580170
1 değiştirilmiş dosya ile 42 ekleme ve 34 silme
  1. 42 34
      distribution/src/main/resources/config/jvm.options

+ 42 - 34
distribution/src/main/resources/config/jvm.options

@@ -1,41 +1,38 @@
-### configuration
+## 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
 
-## basic
-
-# 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
-
-## networking
-
-# force the JVM to use the IPv4 stack
-#-Djava.net.preferIPv4Stack=true
-
-### memory
-
-## heap configuration
-
-# minimum size of total heap space
 -Xms${heap.min}
-
-# maximum size of total heap space
-# it is recommended to set the minimum size and maximum size equal to
-# each other to prevent pauses upon resize, and so that memory locking
-# will lock the entire heap in physical memory
 -Xmx${heap.max}
 
-# size of young generation heap space
-#-Xmn${new.size}
-
-# maximum size of NIO direct-buffer allocations
-#-XX:MaxDirectMemorySize${max.direct.memory.size}
-
-## CMS configuration
+################################################################
+## 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:+UseParNewGC
 -XX:+UseConcMarkSweepGC
 -XX:CMSInitiatingOccupancyFraction=75
@@ -49,6 +46,17 @@
 # pre-touch memory pages used by the JVM during initialization
 -XX:+AlwaysPreTouch
 
+## basic
+
+# 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