[ 
https://issues.apache.org/jira/browse/KAFKA-3754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15994280#comment-15994280
 ] 

James Cheng commented on KAFKA-3754:
------------------------------------

FYI, I tried out this change in my cluster today. The JVM's GC log rotation 
isn't what I expected:
{code}
$ ls -ltr --full-time kafkaServer-gc.log*
-rw-r--r--. 1 root root 2829636 2017-05-03 00:48:26.000000000 +0000 
kafkaServer-gc.log
-rw-r--r--. 1 root root  103794 2017-05-03 00:57:01.000000000 +0000 
kafkaServer-gc.log.0
-rw-r--r--. 1 root root   14939 2017-05-03 00:59:59.000000000 +0000 
kafkaServer-gc.log.1.current
{code}

It writes to kafkaServer-gc.log, then .log.1, then log.2, etc, until it reaches 
10 (the number I configured) and then wraps back around to kafkaServer-gc.log.

I had expected that "kafkaServer-gc.log" would always be the current one, and 
then the .1 .2 .3 etc would be progressively older ones.

Just thought I'd share that info, in case others are interested. But, it *does* 
rotate the logs, and so will limit disk usage.


> Kafka default -Xloggc settings should include GC log rotation flags
> -------------------------------------------------------------------
>
>                 Key: KAFKA-3754
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3754
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Ryan P
>            Assignee: Ryan P
>            Priority: Minor
>
> By default kafka-run-class.sh defines it's GC settings like so:
> KAFKA_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc 
> -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps "
> This has to potential to generate incredibly large log files when left 
> unmanaged. 
> Instead it should include some sort of default GC log retention policy by 
> adding the following flags:
> -XX:+UseGCLogFileRotation 
> -XX:NumberOfGCLogFiles= <number of files>
>  -XX:GCLogFileSize=<size of files>
> http://www.oracle.com/technetwork/java/javase/7u2-relnotes-1394228.html 
> details these flags and their defaults



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to