Morningstar / kafka-offset-monitor

A small web app to monitor the progress of kafka consumers and their lag wrt the log.
Apache License 2.0
282 stars 108 forks source link

how to reduce high CPU ? #14

Closed ptdontlv closed 6 years ago

ptdontlv commented 6 years ago

Thank you for this tool. It works on my cluster(kafka0.10.2).But I find that this java program use a lot cpu, about 30-50%(useing order 'top' can see this) The old kom for kafka0.8 only use 0-0.7% CPU in another cluster, how to fix this? the start order : java -cp KafkaOffsetMonitor-assembly-0.4.1-SNAPSHOT.jar \ com.quantifind.kafka.offsetapp.OffsetGetterWeb \ --offsetStorage kafka \ --kafkaBrokers 1.1.1.1:9092 \ --kafkaSecurityProtocol PLAINTEXT \ --zk 1.1.1.2:2181/testapp/kafka \ --port 8888 \ --refresh 10.seconds \ --retain 2.days \ --dbName kafka

rcasey212 commented 6 years ago

Hi @ptdontlv ,

You can try setting your refresh period to something less frequent:

--refresh 1.minute