栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

KAFKA性能测试

KAFKA性能测试

KAFKA性能测试
  • 一、生产者性能测试
  • 二、消费者性能测试

Kafka集群提供了一个kafka-producer-perf-test.sh、kafka-consumer-perf-test.sh脚本为生产者、消费者提供性能测试,有一系列的参数,我们的性能测试是基于这两个脚本来进行的,分别来测试一下。

一、生产者性能测试
$KAFKA_HOME/bin/kafka-producer-perf-test.sh --topic test666 --record-size 100 --num-records 30000 --throughput 1000 --producer-props bootstrap.servers=hadoop66:9092,hadoop67:9092,hadoop68:9092

各个参数的意义为:

    --topic:主题名
    --record-size:每条消息大小,单位KB
    --num-records:总共发送消息
    --throughput :每秒发送条消息条数

执行完这条命令后,如下图所示:

5002 records sent, 1000.4 records/sec (0.10 MB/sec), 0.7 ms avg latency, 135.0 max latency.
5002 records sent, 1000.2 records/sec (0.10 MB/sec), 0.4 ms avg latency, 21.0 max latency.
5002 records sent, 1000.0 records/sec (0.10 MB/sec), 0.5 ms avg latency, 20.0 max latency.
5001 records sent, 1000.0 records/sec (0.10 MB/sec), 0.5 ms avg latency, 18.0 max latency.
5001 records sent, 1000.0 records/sec (0.10 MB/sec), 0.6 ms avg latency, 28.0 max latency.
30000 records sent, 999.933338 records/sec (0.10 MB/sec), 0.53 ms avg latency, 135.00 ms max latency, 0 ms 50th, 1 ms 95th, 5 ms 99th, 20 ms 99.9th.

本次测试一共发送3w条消息,每秒999.9条,每秒向Kafka写入0.1MB的数据,平均每次写入延迟的时间为0.53ms,最大135ms

二、消费者性能测试
$KAFKA_HOME/bin/kafka-consumer-perf-test.sh --zookeeper hadoop66:2181,hadoop67:2181,hadoop68:2181 --topic test666 --fetch-size 1000 --messages 300000 --threads 1

其中各个参数的意义为:

	--topic:主题
	--zookeeper:zookeeper地址
	--fetch-size:每次消费数据的大小,单位KB
	--messages:一共要消费的总消息数

执行完以后,如下图所示:

start.time, end.time,data.consumed.in.MB,MB.sec, data.consumed.in.nMsg, nMsg.sec
2020-04-24 09:33:19:754, 2020-04-24 09:33:21:294, 4.7684, 3.0963, 50000, 32467.5325

开始时间,结束时间,最大吞吐率(data.consumed.in.MB):4.7684MB/s,平均每秒吞吐率(MB.sec),最大每秒消费(data.consumed.in.nMsg):5000,平均每秒消费(nMsg.sec):32467.5

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/663552.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号