Odd GC values in solr.in.sh on 7.2.1

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Odd GC values in solr.in.sh on 7.2.1

Bram Van Dam
Hey folks,

solr.in.sh appears to contain broken GC suggestions:

# These GC settings have shown to work well for a number of common Solr
workloads
#GC_TUNE="-XX:NewRatio=3 -XX:SurvivorRatio=4    etc.

The "etc." part is copied verbatim from the file. It looks likes the
original GC_TUNE settings have partially disappeared.

Here they are copied from 5.X:

# These GC settings have shown to work well for a number of common Solr
workloads
GC_TUNE="-XX:NewRatio=3 \
-XX:SurvivorRatio=4 \
-XX:TargetSurvivorRatio=90 \
-XX:MaxTenuringThreshold=8 \
-XX:+UseConcMarkSweepGC \
-XX:+UseParNewGC \
-XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 \
-XX:+CMSScavengeBeforeRemark \
-XX:PretenureSizeThreshold=64m \
-XX:+UseCMSInitiatingOccupancyOnly \
-XX:CMSInitiatingOccupancyFraction=50 \
-XX:CMSMaxAbortablePrecleanTime=6000 \
-XX:+CMSParallelRemarkEnabled \
-XX:+ParallelRefProcEnabled"

Are these settings no longer recommended? Or is there a new mechanism
other than solr.in.sh where these might be configured?

Thanks,

 - Bram
Reply | Threaded
Open this post in threaded view
|

Re: Odd GC values in solr.in.sh on 7.2.1

Shawn Heisey-2
On 2/21/2018 7:51 AM, Bram Van Dam wrote:
> solr.in.sh appears to contain broken GC suggestions:
>
> # These GC settings have shown to work well for a number of common Solr
> workloads
> #GC_TUNE="-XX:NewRatio=3 -XX:SurvivorRatio=4    etc.

In 5.x, the default environment variables were specified in solr.in.sh,
but now they are all in the bin/solr script itself. On recent versions,
you should find everything commented in solr.in.sh, serving only as
examples.  When run with out-of-the-box config, Solr still ends up using
GC tuning that's extremely similar to what 5.x had, unless you override
it in the include script.  You can see what actually gets used if you
visit the admin UI dashboard.

The line you mentioned with the "etc." on it is a commented
configuration line.  Which means it isn't actually active.  Note the #
symbol as the first character of the line.

So this is not a real problem, but we could probably do better, because
if the example is uncommented and not changed at all, Solr probably
won't even start.

Here's an enhancement idea:

# The GC tuning can be overridden with the GC_TUNE setting.
# Here's one variation that you can uncomment:
#GC_TUNE=" \
#-XX:+UseG1GC \
#-XX:+ParallelRefProcEnabled \
#-XX:G1HeapRegionSize=8m \
#-XX:MaxGCPauseMillis=250 \
#-XX:InitiatingHeapOccupancyPercent=75 \
#-XX:+AggressiveOpts \
#"

Disclaimer: These options came from settings that I have documented on
my personal page in the Solr wiki.  I removed a couple of the more
controversial options that I'm using from the commented example above.

https://wiki.apache.org/solr/ShawnHeisey#GC_Tuning_for_Solr

Because of the dire warnings from Lucene, having a G1 config in Solr,
even one that's not active by default, might be too controversial to
actually implement.

Thanks,
Shawn