You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by is...@apache.org on 2019/04/25 08:29:48 UTC

[lucene-solr] branch branch_8x updated: SOLR-13394: Switch default GC from CMS to G1

This is an automated email from the ASF dual-hosted git repository.

ishan pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 430f059  SOLR-13394: Switch default GC from CMS to G1
430f059 is described below

commit 430f0593805168a3e7abdbfa535528f5584d476a
Author: Ishan Chattopadhyaya <is...@apache.org>
AuthorDate: Thu Apr 25 13:58:43 2019 +0530

    SOLR-13394: Switch default GC from CMS to G1
---
 solr/CHANGES.txt     |  6 ++++++
 solr/bin/solr        | 19 ++++++-------------
 solr/bin/solr.cmd    | 21 +++++++--------------
 solr/bin/solr.in.cmd | 15 ++++++++++++++-
 solr/bin/solr.in.sh  | 15 ++++++++++++++-
 5 files changed, 47 insertions(+), 29 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 384f704..e48856b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -63,6 +63,8 @@ Upgrade Notes
 * Custom TransientSolrCoreCache implementations no longer use the Observer/Observable pattern. To notify Solr that
   a core has been aged out of the cache, call CoreContainer.queueCoreToClose(SolrCore). See SOLR-13400 for details.
 
+* SOLR-13394: The default GC has been changed from CMS to G1. To override this (in order to switch to CMS or any
+  other GC), use GC_TUNE section of bin/solr.in.sh or bin/solr.in.cmd.
 
 New Features
 ----------------------
@@ -220,6 +222,10 @@ Improvements
 * SOLR-12167: Throw an exception, instead of just a warning, when unknown atomic update operation is 
   encountered (Munendra S N via Ishan Chattopadhyaya)
 
+* SOLR-13394: Switch default GC from CMS to G1 (Ishan Chattopadhyaya, Kesharee Nandan Vishwakarma, Shawn Heisey,
+  Uwe Schindler, Erick Ericsson)
+
+
 Other Changes
 ----------------------
 
diff --git a/solr/bin/solr b/solr/bin/solr
index 8306609..1d01ded 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -2018,20 +2018,13 @@ function start_solr() {
 
   # define default GC_TUNE
   if [ -z ${GC_TUNE+x} ]; then
-      GC_TUNE=('-XX:NewRatio=3' \
-        '-XX:SurvivorRatio=4' \
-        '-XX:TargetSurvivorRatio=90' \
-        '-XX:MaxTenuringThreshold=8' \
-        '-XX:+UseConcMarkSweepGC' \
-        '-XX:ConcGCThreads=4' '-XX:ParallelGCThreads=4' \
-        '-XX:+CMSScavengeBeforeRemark' \
-        '-XX:PretenureSizeThreshold=64m' \
-        '-XX:+UseCMSInitiatingOccupancyOnly' \
-        '-XX:CMSInitiatingOccupancyFraction=50' \
-        '-XX:CMSMaxAbortablePrecleanTime=6000' \
-        '-XX:+CMSParallelRemarkEnabled' \
+      GC_TUNE=('-XX:+UseG1GC' \
+        '-XX:+PerfDisableSharedMem' \
         '-XX:+ParallelRefProcEnabled' \
-        '-XX:-OmitStackTraceInFastThrow')
+        '-XX:G1HeapRegionSize=16m' \
+        '-XX:MaxGCPauseMillis=250' \
+        '-XX:InitiatingHeapOccupancyPercent=45' \
+        '-XX:+UseLargePages')
   else
     GC_TUNE=($GC_TUNE)
   fi
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index d3932bf..2679a72 100755
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -1167,20 +1167,13 @@ set SOLR_OPTS=%SOLR_JAVA_STACK_SIZE% %SOLR_OPTS%
 IF "%SOLR_TIMEZONE%"=="" set SOLR_TIMEZONE=UTC
 
 IF "%GC_TUNE%"=="" (
-  set GC_TUNE=-XX:NewRatio=3 ^
-   -XX:SurvivorRatio=4 ^
-   -XX:TargetSurvivorRatio=90 ^
-   -XX:MaxTenuringThreshold=8 ^
-   -XX:+UseConcMarkSweepGC ^
-   -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 ^
-   -XX:+CMSScavengeBeforeRemark ^
-   -XX:PretenureSizeThreshold=64m ^
-   -XX:+UseCMSInitiatingOccupancyOnly ^
-   -XX:CMSInitiatingOccupancyFraction=50 ^
-   -XX:CMSMaxAbortablePrecleanTime=6000 ^
-   -XX:+CMSParallelRemarkEnabled ^
-   -XX:+ParallelRefProcEnabled ^
-   -XX:-OmitStackTraceInFastThrow
+  set GC_TUNE=-XX:+UseG1GC ^
+    -XX:+PerfDisableSharedMem ^
+    -XX:+ParallelRefProcEnabled ^
+    -XX:G1HeapRegionSize=16m ^
+    -XX:MaxGCPauseMillis=250 ^
+    -XX:InitiatingHeapOccupancyPercent=45 ^
+    -XX:+UseLargePages
 )
 
 if !JAVA_MAJOR_VERSION! GEQ 9  (
diff --git a/solr/bin/solr.in.cmd b/solr/bin/solr.in.cmd
index 639f7e9..3849195 100755
--- a/solr/bin/solr.in.cmd
+++ b/solr/bin/solr.in.cmd
@@ -34,7 +34,20 @@ REM set GC_LOG_OPTS=-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+Prin
 
 REM Various GC settings have shown to work well for a number of common Solr workloads.
 REM See solr.cmd GC_TUNE for the default list.
-REM set GC_TUNE=-XX:NewRatio=3 -XX:SurvivorRatio=4     etc.
+REM set GC_TUNE=-XX:SurvivorRatio=4
+REM set GC_TUNE=%GC_TUNE% -XX:TargetSurvivorRatio=90
+REM set GC_TUNE=%GC_TUNE% -XX:MaxTenuringThreshold=8
+REM set GC_TUNE=%GC_TUNE% -XX:+UseConcMarkSweepGC
+REM set GC_TUNE=%GC_TUNE% -XX:ConcGCThreads=4
+REM set GC_TUNE=%GC_TUNE% -XX:ParallelGCThreads=4
+REM set GC_TUNE=%GC_TUNE% -XX:+CMSScavengeBeforeRemark
+REM set GC_TUNE=%GC_TUNE% -XX:PretenureSizeThreshold=64m
+REM set GC_TUNE=%GC_TUNE% -XX:+UseCMSInitiatingOccupancyOnly
+REM set GC_TUNE=%GC_TUNE% -XX:CMSInitiatingOccupancyFraction=50
+REM set GC_TUNE=%GC_TUNE% -XX:CMSMaxAbortablePrecleanTime=6000
+REM set GC_TUNE=%GC_TUNE% -XX:+CMSParallelRemarkEnabled
+REM set GC_TUNE=%GC_TUNE% -XX:+ParallelRefProcEnabled
+REM set GC_TUNE=%GC_TUNE% -XX:-OmitStackTraceInFastThrow    etc.
 
 REM Set the ZooKeeper connection string if using an external ZooKeeper ensemble
 REM e.g. host1:2181,host2:2181/chroot
diff --git a/solr/bin/solr.in.sh b/solr/bin/solr.in.sh
index b67f770..832e3cb 100644
--- a/solr/bin/solr.in.sh
+++ b/solr/bin/solr.in.sh
@@ -46,7 +46,20 @@
 #  -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime"
 
 # These GC settings have shown to work well for a number of common Solr workloads
-#GC_TUNE="-XX:NewRatio=3 -XX:SurvivorRatio=4    etc.
+#GC_TUNE=" \
+#-XX:SurvivorRatio=4 \
+#-XX:TargetSurvivorRatio=90 \
+#-XX:MaxTenuringThreshold=8 \
+#-XX:+UseConcMarkSweepGC \
+#-XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 \
+#-XX:+CMSScavengeBeforeRemark \
+#-XX:PretenureSizeThreshold=64m \
+#-XX:+UseCMSInitiatingOccupancyOnly \
+#-XX:CMSInitiatingOccupancyFraction=50 \
+#-XX:CMSMaxAbortablePrecleanTime=6000 \
+#-XX:+CMSParallelRemarkEnabled \
+#-XX:+ParallelRefProcEnabled \
+#-XX:-OmitStackTraceInFastThrow  etc.
 
 # Set the ZooKeeper connection string if using an external ZooKeeper ensemble
 # e.g. host1:2181,host2:2181/chroot