NOTE
2.11 Kafka Benchmarking
Kafka load testing involves estimating the QPS supported by a partition and machine. These notes connect publication flows with performance testing.
This is a historical learning note and may contain outdated or incomplete understanding.
1. Benchmarking
1.1. Producer
kafka-producer-perf-test.sh --topic test_perf --num-records 100000 --record-size 1000 --throughput 2000 --producer-props bootstrap.servers=127.0.0.1:9092
1.2. Consumer
./kafka-consumer-perf-test.sh --broker-list 127.0.0.1:9092 --topic test_perf --fetch-size 1048576 --messages 100000 --threads 1
2. Determining the Number of Partitions and Machines
Same as Release in Business System Design Analysis Approach.
- Calculate the QPS that a single partition/machine can support. Refer to Stress Testing.md (the related note has not yet been published).
- Calculate the number of partitions/machines = estimated business QPS / QPS supported by a single partition/machine + some spare capacity.
3. References
Drag to pan, scroll to zoom, and click a node to expand or collapse it. Large maps start with deeper levels collapsed; click nodes to expand them.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub