Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-2418

default gc log settings overwrite previous log

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 0.7.5
    • None
    • None
    • Low

    Description

      For those spoiled by nice rolling and appending syslogs log4js etc the JVM gc log can be jarring:

       
      # GC logging options -- uncomment to enable
      # JVM_OPTS="$JVM_OPTS -XX:+PrintGCDetails"
      # JVM_OPTS="$JVM_OPTS -XX:+PrintGCTimeStamps"
      # JVM_OPTS="$JVM_OPTS -XX:+PrintClassHistogram"
      # JVM_OPTS="$JVM_OPTS -XX:+PrintTenuringDistribution"
      # JVM_OPTS="$JVM_OPTS -XX:+PrintGCApplicationStoppedTime"
      # JVM_OPTS="$JVM_OPTS -Xloggc:/var/log/cassandra/gc.log"
      

      Will result in gc.log with days of data being overwritten on restart, which leads to sad faces.

      The simplest change would be along these lines:

       
      GC_LOG_TS=`date +%s`
      JVM_OPTS="$JVM_OPTS -XX:+PrintGCDetails"
      JVM_OPTS="$JVM_OPTS -XX:+PrintGCTimeStamps"
      JVM_OPTS="$JVM_OPTS -XX:+PrintClassHistogram"
      JVM_OPTS="$JVM_OPTS -XX:+PrintTenuringDistribution"
      JVM_OPTS="$JVM_OPTS -XX:+PrintGCApplicationStoppedTime"
      JVM_OPTS="$JVM_OPTS -Xloggc:/var/log/cassandra/gc-$GC_LOG_TS.log"
      

      There are probably prettier approaches.

      Attachments

        1. 2418.txt
          0.7 kB
          Jonathan Ellis

        Activity

          People

            cburroughs Chris Burroughs
            cburroughs Chris Burroughs
            Chris Burroughs
            Jonathan Ellis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: