Enable GC logging by default (3.0 version)

patch by Chris Lohfink; reviewed by aweisberg for CASSANDRA-10140
This commit is contained in:
Ariel Weisberg 2015-12-29 14:33:26 -05:00 committed by Sylvain Lebresne
parent 2fd0c15b27
commit 3e45fa1ab5
6 changed files with 34 additions and 13 deletions

View File

@ -11,6 +11,7 @@
* (Hadoop) Close Clusters and Sessions in Hadoop Input/Output classes (CASSANDRA-10837)
* Fix sstableloader not working with upper case keyspace name (CASSANDRA-10806)
Merged from 2.2:
* Enable GC logging by default (CASSANDRA-10140)
* Optimize pending range computation (CASSANDRA-9258)
* Skip commit log and saved cache directories in SSTable version startup check (CASSANDRA-10902)
* drop/alter user should be case sensitive (CASSANDRA-10817)

View File

@ -32,6 +32,8 @@ Upgrading
- Custom index implementation should be aware that the method Indexer::indexes()
has been removed as its contract was misleading and all custom implementation
should have almost surely returned true inconditionally for that method.
- GC logging is now enabled by default (you can disable it in the jvm.options
file if you prefer).
3.0

View File

@ -333,6 +333,9 @@ Function SetCassandraEnvironment
ParseJVMInfo
#GC log path has to be defined here since it needs to find CASSANDRA_HOME
$env:JVM_OPTS="$env:JVM_OPTS -Xloggc:$env:CASSANDRA_HOME/logs/gc.log"
# Read user-defined JVM options from jvm.options file
$content = Get-Content "$env:CASSANDRA_CONF\jvm.options"
for ($i = 0; $i -lt $content.Count; $i++)

View File

@ -33,7 +33,7 @@ calculate_heap_sizes()
Darwin)
system_memory_in_bytes=`sysctl hw.memsize | awk '{print $2}'`
system_memory_in_mb=`expr $system_memory_in_bytes / 1024 / 1024`
system_cpu_cores=`sysctl hw.ncpu | awk '{print $2}'`
;;
*)
# assume reasonable defaults for e.g. a modern desktop or
@ -156,6 +156,9 @@ if [ "x$MALLOC_ARENA_MAX" = "x" ] ; then
export MALLOC_ARENA_MAX=4
fi
#GC log path has to be defined here because it needs to access CASSANDRA_HOME
JVM_OPTS="$JVM_OPTS -Xloggc:${CASSANDRA_HOME}/logs/gc.log"
# Here we create the arguments that will get passed to the jvm when
# starting cassandra.

View File

@ -95,14 +95,14 @@
### GC logging options -- uncomment to enable
#-XX:+PrintGCDetails
#-XX:+PrintGCDateStamps
#-XX:+PrintHeapAtGC
#-XX:+PrintTenuringDistribution
#-XX:+PrintGCApplicationStoppedTime
#-XX:+PrintPromotionFailure
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintHeapAtGC
-XX:+PrintTenuringDistribution
-XX:+PrintGCApplicationStoppedTime
-XX:+PrintPromotionFailure
#-XX:PrintFLSStatistics=1
#-Xloggc:/var/log/cassandra/gc.log
#-XX:+UseGCLogFileRotation
#-XX:NumberOfGCLogFiles=10
#-XX:GCLogFileSize=10M
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=10
-XX:GCLogFileSize=10M

View File

@ -6,9 +6,9 @@
@DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cassandra~/bin/cassandra cassandra/bin/cassandra
--- cassandra~/bin/cassandra 2014-09-15 19:42:28.000000000 -0500
+++ cassandra/bin/cassandra 2014-09-15 21:15:15.627505503 -0500
@@ -134,7 +134,7 @@
--- cassandra~/bin/cassandra 2015-10-27 14:35:22.000000000 -0500
+++ cassandra/bin/cassandra 2015-10-27 14:41:38.000000000 -0500
@@ -139,7 +139,7 @@
props="$3"
class="$4"
cassandra_parms="-Dlogback.configurationFile=logback.xml"
@ -17,3 +17,15 @@ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch'
cassandra_parms="$cassandra_parms -Dcassandra.storagedir=$cassandra_storagedir"
if [ "x$pidpath" != "x" ]; then
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cassandra~/conf/cassandra-env.sh cassandra/conf/cassandra-env.sh
--- cassandra~/conf/cassandra-env.sh 2015-10-27 14:40:39.000000000 -0500
+++ cassandra/conf/cassandra-env.sh 2015-10-27 14:42:40.647449856 -0500
@@ -204,7 +204,7 @@
esac
#GC log path has to be defined here because it needs to access CASSANDRA_HOME
-JVM_OPTS="$JVM_OPTS -Xloggc:${CASSANDRA_HOME}/logs/gc.log"
+JVM_OPTS="$JVM_OPTS -Xloggc:/var/log/cassandra/gc.log"
# Here we create the arguments that will get passed to the jvm when
# starting cassandra.