kafka的性能测试

扔这里面记录下

./bin/kafka-topics.sh --create --zookeeper 10.104.109.176:2188,10.104.86.238:2188,10.104.122.21:2188 --replication-factor 2 --partitions 6 --topic kafkatest

./bin/kafka-producer-perf-test.sh  \
--topic kafkatest  \
--throughput 1000000  \
--num-records 1000000  \
--producer-props bootstrap.servers=10.104.109.176:9092,10.104.86.238:9092,10.104.122.21:9092 acks="all" linger.ms=5 \
--record-size 1000


当不设置ack和linger.ms  kafka的写入速度真的挺快的

743495 records sent, 148699.0 records/sec (141.81 MB/sec), 175.7 ms avg latency, 377.0 max latency.
1000000 records sent, 157654.106889 records/sec (150.35 MB/sec), 171.21 ms avg latency, 377.00 ms max latency, 190 ms 50th, 331 ms 95th, 357 ms 99th, 370 ms 99.9th.


设置:acks="all"
243496 records sent, 48699.2 records/sec (46.44 MB/sec), 517.3 ms avg latency, 898.0 max latency.
280770 records sent, 56154.0 records/sec (53.55 MB/sec), 535.3 ms avg latency, 1120.0 max latency.
293340 records sent, 58668.0 records/sec (55.95 MB/sec), 511.0 ms avg latency, 1311.0 max latency.
1000000 records sent, 53262.316911 records/sec (50.79 MB/sec), 537.54 ms avg latency, 1430.00 ms max latency, 361 ms 50th, 1305 ms 95th, 1417 ms 99th, 1427 ms 99.9th.

设置:acks="all"  linger.ms=4
284631 records sent, 56926.2 records/sec (54.29 MB/sec), 436.6 ms avg latency, 667.0 max latency.
311982 records sent, 62396.4 records/sec (59.51 MB/sec), 481.0 ms avg latency, 913.0 max latency.
300600 records sent, 60120.0 records/sec (57.33 MB/sec), 509.2 ms avg latency, 984.0 max latency.
1000000 records sent, 58578.876457 records/sec (55.87 MB/sec), 486.81 ms avg latency, 984.00 ms max latency, 553 ms 50th, 952 ms 95th, 974 ms 99th, 982 ms 99.9th.

设置:acks="all"  linger.ms=5
284366 records sent, 56873.2 records/sec (54.24 MB/sec), 427.2 ms avg latency, 686.0 max latency.
313170 records sent, 62634.0 records/sec (59.73 MB/sec), 485.4 ms avg latency, 842.0 max latency.
309514 records sent, 61902.8 records/sec (59.04 MB/sec), 487.5 ms avg latency, 1003.0 max latency.
1000000 records sent, 59087.686126 records/sec (56.35 MB/sec), 479.60 ms avg latency, 1022.00 ms max latency, 479 ms 50th, 965 ms 95th, 1004 ms 99th, 1018 ms 99.9th.

设置:acks="all" linger.ms=6
281793 records sent, 56358.6 records/sec (53.75 MB/sec), 443.2 ms avg latency, 815.0 max latency.
298170 records sent, 59634.0 records/sec (56.87 MB/sec), 503.2 ms avg latency, 1091.0 max latency.
302494 records sent, 60498.8 records/sec (57.70 MB/sec), 489.3 ms avg latency, 1340.0 max latency.
1000000 records sent, 56233.481415 records/sec (53.63 MB/sec), 503.94 ms avg latency, 1393.00 ms max latency, 363 ms 50th, 1335 ms 95th, 1365 ms 99th, 1390 ms 99.9th.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
关于Kafka性能测试,您可以考虑以下几个方面: 1. 压力测试:通过模拟大量并发请求,测试Kafka在高负载情况下的性能表现。您可以使用工具如Apache JMeter、Kafka Load Testing Tool等来进行压力测试。 2. 吞吐量测试:测试Kafka在单位时间内能够处理的消息数量。可以通过发送大量消息并记录处理时间来计算吞吐量。同时,可以调整Kafka的配置参数,如分区数量、复制因子等,来观察吞吐量的变化。 3. 延迟测试:测试消息从生产者发送到消费者接收的延迟时间。您可以在消息发送和接收的代码中插入时间戳,并计算两者之间的差值来得到延迟时间。可以通过调整Kafka的配置参数、增加消费者数量等方式来观察延迟的变化。 4. 可用性测试:测试Kafka在出现故障时的可用性。可以模拟节点宕机、网络断开等情况,观察Kafka集群的自动故障转移和恢复能力。 在进行性能测试时,建议注意以下几点: - 确保测试环境与生产环境尽可能相似,包括硬件配置、网络环境等。 - 关注测试结果中的指标,如吞吐量、延迟、丢失率等。 - 注意监控Kafka集群的各项指标,如CPU、内存、网络等的使用情况。 - 尝试不同的场景和配置参数,以获得更全面的性能测试结果。 请注意,以上只是一些常见的性能测试方法,具体测试方案需要根据您的需求和环境来进行调整。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值