Apache Kafka 4 cheatsheet

Apache Kafka 4: Performance and debugging

3 common Apache Kafka 4 tasks.

Test producer throughput

Send 100,000 records of 100 bytes as fast as possible.

bin/kafka-producer-perf-test.sh --topic orders --num-records 100000 --record-size 100 --throughput -1 --producer-props bootstrap.servers=localhost:9092

Test consumer throughput

Read 100,000 messages and report the rate.

bin/kafka-consumer-perf-test.sh --topic orders --messages 100000 --bootstrap-server localhost:9092

Inspect a log segment

Print the messages in a log segment file on a broker's disk.

bin/kafka-dump-log.sh --files /tmp/kraft-combined-logs/orders-0/00000000000000000000.log --print-data-log

Was this page helpful?