经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 大数据/云/AI » Apache Kafka » 查看文章
kafka学习之三_信创CPU下单节点kafka性能测试验证
来源:cnblogs  作者:济南小老虎  时间:2023/6/21 10:52:38  对本文有异议

kafka学习之三_信创CPU下单节点kafka性能测试验证


背景

  1. 前面学习了 3controller+5broker 的集群部署模式.
  2. 晚上想着能够验证一下国产机器的性能. 但是国产机器上面的设备有限.
  3. 所以想着进行单节点的安装与测试. 并且记录一下简单结果
  4. 希望对以后的工作有指导意义
  5. 发现producer的性能比较与之前的 测试结果比较接近.
  6. 但是consumer的测试结果看不出太多头绪来.
  7. 自己对kafka的学习还不够深入, 准备下一期就进行consumer的调优验证.

测试结果验证

CPU类型 producer测试结果 consumer测试结果
sw 3231 7.20 MB/sec 2.62 MB/sec
FT 2500 2.17 MB/sec 测试失败
海光 7285 39.20 MB/sec 5.77 MB/sec
鲲鹏920 41.97 MB/sec 5.6037 MB/sec
倚天710 59.73 MB/sec 6.19 MB/sec
AMD 9T34 72.61 MB/sec 6.68 MB/sec

测试结果

image


广告一下自己的公众号

image


以申威为例进行安装说明

  1. 因为kafka 其实是基于java进行编写的消息队列.
  2. 所以不需要有繁杂的编译等过程.
  3. 只要jdk支持, 理论上就可以进行运行.
  4. 比较麻烦的就是稳定性和性能的表现.
  5. 所以这里进行一下安装与验证.

安装过程-1

  1. 上传文件到/root目录下面并且解压缩
  2. cd /root && tar -zxvf kafka_2.13-3.5.0.tgz
  3. 然后编辑对应的文件:
  4. cat > /root/kafka_2.13-3.5.0/config/kafka_server_jaas.conf <<EOF
  5. KafkaServer {
  6. org.apache.kafka.common.security.plain.PlainLoginModule required
  7. username="admin"
  8. password="Testxxxxxx"
  9. user_admin="Testxxxxxx"
  10. user_comsumer="Testxxxxxx"
  11. user_producer="Testxxxxxx";
  12. };
  13. EOF
  14. # 增加一个客户端配置文件 客户端才可以连接服务器端
  15. cat > /root/kafka_2.13-3.5.0/config/sasl.conf <<EOF
  16. sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="admin" password="Testxxxxxx";
  17. security.protocol=SASL_PLAINTEXT
  18. sasl.mechanism=PLAIN
  19. EOF

安装过程-2

  1. vim /root/kafka_2.13-3.5.0/config/kraft/server.properties
  2. 主要修改的点:
  3. 因为是单节点所以比较简单了:
  4. process.roles=broker,controller
  5. node.id=100
  6. controller.quorum.voters=100@127.0.0.1:9094
  7. listeners=SASL_PLAINTEXT://127.0.0.1:9093,CONTROLLER://127.0.0.1:9094
  8. sasl.enabled.mechanisms=PLAIN
  9. sasl.mechanism.inter.broker.protocol=PLAIN
  10. security.inter.broker.protocol=SASL_PLAINTEXT
  11. allow.evervone.if.no.acl.found=true
  12. advertised.listeners=SASL_PLAINTEXT://127.0.0.1:9093
  13. # 最简单的方法可以删除配置文件的前面 50行, 直接放进去这些内容
  14. vim->:1,50d->paste->edit_ips
  15. 其他ip地址可以如此替换:
  16. sed -i 's/127.0.0.1/10.110.136.41/g' /root/kafka_2.13-3.5.0/config/kraft/server.properties

安装过程-3

  1. 修改启动脚本:
  2. vim /root/kafka_2.13-3.5.0/bin/kafka-server-start.sh
  3. 在任意一个java opt 处增加:
  4. -Djava.security.auth.login.config=/root/kafka_2.13-3.5.0/config/kafka_server_jaas.conf

安装过程-4

  1. # 初始化
  2. /root/kafka_2.13-3.5.0/bin/kafka-storage.sh random-uuid
  3. cd /root/kafka_2.13-3.5.0
  4. bin/kafka-storage.sh format -t 7ONT3dn3RWWNCZyIwLrEqg -c config/kraft/server.properties
  5. # 启动服务
  6. cd /root/kafka_2.13-3.5.0 && bin/kafka-server-start.sh -daemon config/kraft/server.properties
  7. # 创建topic
  8. bin/kafka-topics.sh --create --command-config config/sasl.conf --replication-factor 1 --partitions 3 --topic zhaobsh01 --bootstrap-server 127.0.0.1:9093
  9. # 测试producer
  10. bin/kafka-producer-perf-test.sh --num-records 100000 --record-size 1024 --throughput -1 --producer.config config/sasl.conf --topic zhaobsh01 --print-metrics --producer-props bootstrap.servers=127.0.0.1:9093
  11. # 测试consumer
  12. bin/kafka-consumer-perf-test.sh --fetch-size 10000 --messages 1000000 --topic zhaobsh01 --consumer.config config/sasl.conf --print-metrics --bootstrap-server 127.0.0.1:9093
  13. # 查看日志
  14. tail -f /root/kafka_2.13-3.5.0/logs/kafkaServer.out

申威的测试结果

  1. producer:
  2. 100000 records sent, 7370.283019 records/sec (7.20 MB/sec), 2755.49 ms avg latency, 3794.00 ms max latency, 3189 ms 50th, 3688 ms 95th, 3758 ms 99th, 3785 ms 99.9th.
  3. consumer:
  4. start.time, end.time, data.consumed.in.MB, MB.sec, data.consumed.in.nMsg, nMsg.sec, rebalance.time.ms, fetch.time.ms, fetch.MB.sec, fetch.nMsg.sec
  5. 2023-06-20 21:56:02:493, 2023-06-20 21:56:39:755, 97.6563, 2.6208, 100000, 2683.6992, 5599, 31663, 3.0842, 3158.2604

飞腾的测试结果-hdd

  1. producer:
  2. 100000 records sent, 1828.922582 records/sec (1.79 MB/sec), 6999.20 ms avg latency, 51476.00 ms max latency, 875 ms 50th, 21032 ms 95th, 21133 ms 99th, 21167 ms 99.9th.
  3. consumer:

飞腾的测试结果-ssd

  1. producer:
  2. 100000 records sent, 2219.706555 records/sec (2.17 MB/sec), 7073.51 ms avg latency, 41100.00 ms max latency, 1089 ms 50th, 20816 ms 95th, 20855 ms 99th, 20873 ms 99.9th.

海光的测试结果

  1. producer:
  2. 100000 records sent, 40144.520273 records/sec (39.20 MB/sec), 486.67 ms avg latency, 681.00 ms max latency, 456 ms 50th, 657 ms 95th, 674 ms 99th, 678 ms 99.9th.
  3. consumer:
  4. start.time, end.time, data.consumed.in.MB, MB.sec, data.consumed.in.nMsg, nMsg.sec, rebalance.time.ms, fetch.time.ms, fetch.MB.sec, fetch.nMsg.sec
  5. 2023-06-20 22:28:04:364, 2023-06-20 22:28:21:274, 97.6563, 5.7751, 100000, 5913.6606, 3809, 13101, 7.4541, 7633.0051

鲲鹏的测试结果

  1. producer:
  2. 100000 records sent, 42973.785991 records/sec (41.97 MB/sec), 463.69 ms avg latency, 621.00 ms max latency, 472 ms 50th, 593 ms 95th, 612 ms 99th, 619 ms 99.9th.
  3. consumer:
  4. start.time, end.time, data.consumed.in.MB, MB.sec, data.consumed.in.nMsg, nMsg.sec, rebalance.time.ms, fetch.time.ms, fetch.MB.sec, fetch.nMsg.sec
  5. 2023-06-20 22:33:58:168, 2023-06-20 22:34:15:595, 97.6563, 5.6037, 100000, 5738.2223, 3799, 13628, 7.1659, 7337.8339

倚天的测试结果

  1. producer:
  2. 100000 records sent, 61162.079511 records/sec (59.73 MB/sec), 335.18 ms avg latency, 498.00 ms max latency, 326 ms 50th, 476 ms 95th, 494 ms 99th, 497 ms 99.9th.
  3. consumer:
  4. start.time, end.time, data.consumed.in.MB, MB.sec, data.consumed.in.nMsg, nMsg.sec, rebalance.time.ms, fetch.time.ms, fetch.MB.sec, fetch.nMsg.sec
  5. 2023-06-20 22:37:49:668, 2023-06-20 22:38:05:426, 97.6563, 6.1972, 100000, 6345.9830, 3597, 12161, 8.0303, 8223.008

AMD9T34的测试结果

  1. producer:
  2. 100000 records sent, 74349.442379 records/sec (72.61 MB/sec), 253.07 ms avg latency, 364.00 ms max latency, 259 ms 50th, 344 ms 95th, 359 ms 99th, 363 ms 99.9th.
  3. consumer:
  4. start.time, end.time, data.consumed.in.MB, MB.sec, data.consumed.in.nMsg, nMsg.sec, rebalance.time.ms, fetch.time.ms, fetch.MB.sec, fetch.nMsg.sec
  5. 2023-06-20 22:44:14:446, 2023-06-20 22:44:29:058, 97.6563, 6.6833, 100000, 6843.6901, 3504, 11108, 8.7915, 9002.5207

原文链接:https://www.cnblogs.com/jinanxiaolaohu/p/17495110.html

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号