Skip to content

Commit

Permalink
Revert removal of default GC configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
malliaridis committed Dec 1, 2024
1 parent 41ada76 commit e46d13e
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion solr/benchmark/jmh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ echo "running JMH with args: $@"
# MRM: I've also seen 15 claimed as a sweet spot.

jvmArgs="-jvmArgs -Djmh.shutdownTimeout=5 -jvmArgs -Djmh.shutdownTimeout.step=3 -jvmArgs -Djava.security.egd=file:/dev/./urandom -jvmArgs -XX:+UnlockDiagnosticVMOptions -jvmArgs -XX:+DebugNonSafepoints -jvmArgs --add-opens=java.base/java.lang.reflect=ALL-UNNAMED"
gcArgs="-jvmArgs -XX:+ParallelRefProcEnabled"
gcArgs="-jvmArgs -XX:+UseG1GC -jvmArgs -XX:+ParallelRefProcEnabled"

# -jvmArgs -Dlog4j2.debug
loggingArgs="-jvmArgs -Dlog4jConfigurationFile=./log4j2-bench.xml -jvmArgs -Dlog4j2.is.webapp=false -jvmArgs -Dlog4j2.garbagefreeThreadContextMap=true -jvmArgs -Dlog4j2.enableDirectEncoders=true -jvmArgs -Dlog4j2.enable.threadlocals=true"
Expand Down
3 changes: 2 additions & 1 deletion solr/bin/solr
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,8 @@ function start_solr() {

# define default GC_TUNE
if [ -z "${GC_TUNE}" ]; then
GC_TUNE_ARR=('-XX:+PerfDisableSharedMem' \
GC_TUNE_ARR=('-XX:+UseG1GC' \
'-XX:+PerfDisableSharedMem' \
'-XX:+ParallelRefProcEnabled' \
'-XX:MaxGCPauseMillis=250' \
'-XX:+UseLargePages' \
Expand Down
3 changes: 2 additions & 1 deletion solr/bin/solr.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,8 @@ set SCRIPT_SOLR_OPTS=%SOLR_JAVA_STACK_SIZE% %SCRIPT_SOLR_OPTS%
IF "%SOLR_TIMEZONE%"=="" set SOLR_TIMEZONE=UTC

IF "%GC_TUNE%"=="" (
set GC_TUNE=-XX:+PerfDisableSharedMem ^
set GC_TUNE=-XX:+UseG1GC ^
-XX:+PerfDisableSharedMem ^
-XX:+ParallelRefProcEnabled ^
-XX:MaxGCPauseMillis=250 ^
-XX:+UseLargePages ^
Expand Down
7 changes: 7 additions & 0 deletions solr/cross-dc-manager/bin/cross-dc-manager
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ else
JAVA_MEM_OPTS="-Xms$JAVA_HEAP -Xmx$JAVA_HEAP"
fi

# define default GC_TUNE
if [ -z ${GC_TUNE+x} ]; then
GC_TUNE='-XX:+UseG1GC'
else
GC_TUNE="$GC_TUNE"
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
Expand Down
1 change: 1 addition & 0 deletions solr/cross-dc-manager/bin/cross-dc-manager.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ set BASEDIR=%~dp0..

IF NOT "%JAVA_HEAP%"=="" set JAVA_MEM=-Xms%JAVA_HEAP% -Xmx%JAVA_HEAP%
IF "%JAVA_MEM%"=="" set JAVA_MEM=-Xms512m -Xmx512m
IF "%GC_TUNE%"=="" set GC_TUNE=-XX:+UseG1GC

if "%JAVACMD%"=="" set JAVACMD=java

Expand Down
7 changes: 7 additions & 0 deletions solr/prometheus-exporter/bin/solr-exporter
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ else
JAVA_MEM_OPTS="-Xms$JAVA_HEAP -Xmx$JAVA_HEAP"
fi

# define default GC_TUNE
if [ -z ${GC_TUNE+x} ]; then
GC_TUNE='-XX:+UseG1GC'
else
GC_TUNE="$GC_TUNE"
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
Expand Down
1 change: 1 addition & 0 deletions solr/prometheus-exporter/bin/solr-exporter.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ set BASEDIR=%~dp0..

IF NOT "%JAVA_HEAP%"=="" set JAVA_MEM=-Xms%JAVA_HEAP% -Xmx%JAVA_HEAP%
IF "%JAVA_MEM%"=="" set JAVA_MEM=-Xms512m -Xmx512m
IF "%GC_TUNE%"=="" set GC_TUNE=-XX:+UseG1GC

if "%JAVACMD%"=="" set JAVACMD=java

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ curl http://localhost:8983/solr/admin/info/system
"classpath":"start.jar",
"commandLineArgs":["-Xms512m",
"-Xmx512m",
"-XX:+UseG1GC",
"-XX:+PerfDisableSharedMem",
"-XX:+ParallelRefProcEnabled",
"-XX:MaxGCPauseMillis=250",
Expand Down Expand Up @@ -283,6 +284,7 @@ curl http://localhost:8983/solr/gettingstarted/admin/system
"classpath":"start.jar",
"commandLineArgs":["-Xms512m",
"-Xmx512m",
"-XX:+UseG1GC",
"-XX:+PerfDisableSharedMem",
"-XX:+ParallelRefProcEnabled",
"-XX:MaxGCPauseMillis=250",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ This is ignored if `JAVA_HEAP` is provided.
+
[%autowidth,frame=none]
|===
|Optional |Default: none
|Optional |Default: `-XX:+UseG1GC`
|===
+
Custom Java garbage collection settings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ The status command should give some basic information about the running Solr nod
Tasks: 41 (limit: 25056)
Memory: 517.1M
CGroup: /system.slice/solr.service
└─3708 java -server -Xms256M -Xmx512M -XX:+PerfDisableSharedMem -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=250 -XX:+UseLargePages -XX:+AlwaysPreTouch -Xlog:gc*:file=/var/solr/logs/solr_gc.log:time,...
└─3708 java -server -Xms256M -Xmx512M -XX:+UseG1GC -XX:+PerfDisableSharedMem -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=250 -XX:+UseLargePages -XX:+AlwaysPreTouch -Xlog:gc*:file=/var/solr/logs/solr_gc.log:time,...
Apr 16 20:41:47 localhost.localdomain systemd[1]: Starting Apache Solr...
Apr 16 20:42:01 localhost.localdomain solr[3661]: [326B blob data]
Apr 16 20:42:01 localhost.localdomain solr[3661]: Started Solr server on port 8983 (pid=3708). Happy searching!
Expand Down

0 comments on commit e46d13e

Please sign in to comment.