lucidworks/gc-log-analyzer

Name: gc-log-analyzer

Owner: Lucidworks

Description: Java GC log parser / analyzer for Java 7 and 8

Created: 2015-03-09 16:20:00.0

Updated: 2018-05-12 21:31:04.0

Pushed: 2016-04-13 19:08:29.0

Homepage: null

Size: 720

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Java GC Log Analyzer

Java GC log parser / analyzer for Java 7 and 8

Getting Started

1) Build the project using Maven:

clean package

2) Enable the following flags on the Java process you want to analyze logs for:

bose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCCause \
+PrintGCDateStamps -XX:+PrintTenuringDistribution \
+PrintGCApplicationStoppedTime \
+UseConcMarkSweepGC \
+UseParNewGC \
ggc:/var/solr/logs/solr_gc.log

The -Xloggc setting sets the location where Java will write the GC log, please update that parameter for your system; you'll need to pass the path to this file when invoking the analyzer in step 4 below.

Currently, the parser only works with the CMS and ParNew collectors on Java 7 or 8, consequently, you can only analyze logs for JVMs run with these flags set: -XX:+UseConcMarkSweepGC -XX:+UseParNewGC

NOTE: Support for G1 is under-construction and will be added in the future.

FWIW, here are the full GC tuning settings I'm using successfully to support complex faceting / sorting queries in Solr:

va.net.preferIPv4Stack=true \
er.timezone=UTC \
ggc:/var/solr/logs/solr_gc.log \
+PrintGCApplicationStoppedTime \
+PrintTenuringDistribution \
+PrintGCDateStamps \
+PrintGCCause \
+PrintGCDetails \
+PrintHeapAtGC \
bose:gc \
CMSTriggerPermRatio=80 \
CMSFullGCsBeforeCompaction=1 \
+ParallelRefProcEnabled \
+CMSParallelRemarkEnabled \
CMSMaxAbortablePrecleanTime=6000 \
CMSInitiatingOccupancyFraction=50 \
+UseCMSInitiatingOccupancyOnly \
PretenureSizeThreshold=64m \
+CMSScavengeBeforeRemark \
ParallelGCThreads=6 \
ConcGCThreads=6 \
+UseParNewGC \
+UseConcMarkSweepGC \
MaxTenuringThreshold=8 \
TargetSurvivorRatio=90 \
SurvivorRatio=4 \
NewRatio=2 \
12g \
12g \
256k

3) Optionally, setup a SolrCloud collection to index GC event data for deeper analysis with Fusion/Banana.

4) Run the GC log analyzer command-line application in tail mode and send events into Solr:

 -jar target/gc-log-analyzer-0.1-exe.jar \
ail \
og /var/solr/logs/solr_gc.log \
avaHostAndPort localhost:8983 \
avaPid 1234 \
avaVers 1.7 \
kHost localhost:2181 \
ollection my_gc_logs

Notice that you need to pass some basic information about the JVM process that created the log. This information is simply passed through in the docs sent to Solr so you can keep track of your GC logs on multiple machines in a cluster.

For more information about all the command-line options, simply do:

 -jar target/gc-log-analyzer-0.1-exe.jar -help

Please send any questions you have about this application to tim.potter@lucidworks.com

Happy GC tuning!


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.