kafka throughput test

In addition to the basic console-producer and the console-consumer scripts can be used to send and receive messages outside a simple test, Kafka also provides performance throughput test scripts, and they are kafka-producer-perf-test.sh kafka-consumer- perf-test.sh script.

topic partition for load balancing, to improve concurrency of reading and writing; copy to availability, containment.

A producer throughput

kafka-producer-perf-test.sh producers for testing throughput, into the specific commands

bin/kafka-producer-perf-test.sh  --topic test_topic --num-records 500000 --record-size 200 --throughput -1 --producer-props  bootstrap.servers=localhost:9092,localhost:9093,localhost:9094 acks=1

operation result:

   These results suggest a kafka producer running on a certain machine is 3mb / s, i.e. bandwidth is 24mb / s, 17411 average transmission of data per second, the average delay is 4.582 seconds, the maximum delay is 8.337 seconds an average of 50% of the sent message requires 4.305 seconds, 6.864 seconds needs 95%, 99%, requires 7.385 seconds, 8.301 seconds 99.9 needed.

Second, consumption in throughput

kafka-consumer-perf-test.sh throughput is used to test the consumer, into the specific commands

bin/kafka-consumer-perf-test.sh --broker-list localhost:9092,localhost:9093,localhost:9094 --fetch-size 200 --messages 500000 --topic test_topic

operation result:

  Consumption is above 500,000 consumer test throughput information, results showed that change in the consumer environment, over 11 seconds in total time consumption of the message 95M, the throughput is 8M / s, i.e. bandwidth is 64M / s.

Guess you like

Origin www.cnblogs.com/cq-yangzhou/p/11464838.html