kafka提供工具kafka-producer-perf-test.sh用以压测,

参数

说明

messages

生产者发送总的消息数量

message-size

每条消息大小

batch-size

每次批量发送消息的数量

topics

生产者发送的topic

threads

生产者使用几个线程同时发送

broker-list

安装kafka服务的机器ip:port列表

producer-num-retries

一个消息失败发送重试次数

request-timeout-ms

一个消息请求发送超时时间

./kafka-producer-perf-test.sh --topic log.business --num-records 1000000 --record-size 500 --throughput 1000000 --threads 100 --batch-size 4096 --producer-props bootstrap.servers=*****:9092 --sync

后来发现,这些参数并不适用,其中message-size,batch-size,threads,sync等参数在1.0.0中不适用,不得已根据脚本提示重新找答案

运行命令:

[udap@10 bin]$ ./kafka-producer-perf-test.sh
usage: producer-performance [-h] --topic TOPIC --num-records NUM-RECORDS [--payload-delimiter PAYLOAD-DELIMITER] --throughput THROUGHPUT [--producer-props PROP-NAME=PROP-VALUE [PROP-NAME=PROP-VALUE ...]]
[--producer.config CONFIG-FILE] [--print-metrics] [--transactional-id TRANSACTIONAL-ID] [--transaction-duration-ms TRANSACTION-DURATION] (--record-size RECORD-SIZE |
--payload-file PAYLOAD-FILE) This tool is used to verify the producer performance. optional arguments:
-h, --help show this help message and exit
--topic TOPIC produce messages to this topic
--num-records NUM-RECORDS
number of messages to produce
--payload-delimiter PAYLOAD-DELIMITER
provides delimiter to be used when --payload-file is provided. Defaults to new line. Note that this parameter will be ignored if --payload-file is not provided. (default: \n)
--throughput THROUGHPUT
throttle maximum message throughput to *approximately* THROUGHPUT messages/sec
--producer-props PROP-NAME=PROP-VALUE [PROP-NAME=PROP-VALUE ...]
kafka producer related configuration properties like bootstrap.servers,client.id etc. These configs take precedence over those passed via --producer.config.
--producer.config CONFIG-FILE
producer config properties file.
--print-metrics print out metrics at the end of the test. (default: false)
--transactional-id TRANSACTIONAL-ID
The transactionalId to use if transaction-duration-ms is > 0. Useful when testing the performance of concurrent transactions. (default: performance-producer-default-transactional-
id)
--transaction-duration-ms TRANSACTION-DURATION
The max age of each transaction. The commitTransaction will be called after this this time has elapsed. Transactions are only enabled if this value is positive. (default: 0) either --record-size or --payload-file must be specified but not both. --record-size RECORD-SIZE
message size in bytes. Note that you must provide exactly one of --record-size or --payload-file.
--payload-file PAYLOAD-FILE
file to read the message payloads from. This works only for UTF-8 encoded text files. Payloads will be read from this file and a payload will be randomly selected when sending
messages. Note that you must provide exactly one of --record-size or --payload-file.

根据提示得到压测命令如下:

./kafka-producer-perf-test.sh --topic log.business --throughput 100000 --num-records 1000000 --record-size 200 --producer-props bootstrap.servers=******:9092 ack=0

其中参数其实脚本都有解释:

--topic topic名称,

--num-records 总共需要发送的消息数,

--record-size 每个记录的字节数,

--throughput 每秒钟发送的记录数,

--producer-props bootstrap.servers=localhost:9092 发送端的配置信息

这里面比之前版本少了好多参数,提示说明producer-props中有一些配置提供,上官网查看:http://kafka.apache.org/documentation/ 找到目录:Producer Configs 发现其中有一些有用的配置,比如acks,batch.size,ssl等,不过这些配置都有默认值,如果值不一样则可以根据提示设置参数,表格比较长,就不摘抄过来了,根据路径过去看。

by the way

kafka性能与每次写入的record size有关,每条记录的大小会严重影响性能,当我记录字节数设置为200时,单点压测性能接近50W requests per second

kafka性能测试1.0.0的更多相关文章

  1. Apache kafka原理与特性(0.8V)

    前言: kafka是一个轻量级的/分布式的/具备replication能力的日志采集组件,通常被集成到应用系统中,收集"用户行为日志"等,并可以使用各种消费终端(consumer) ...

  2. 【转载】Apache kafka原理与特性(0.8V)

    http://blog.csdn.net/xiaolang85/article/details/37821209 前言: kafka是一个轻量级的/分布式的/具备replication能力的日志采集组 ...

  3. Java API获取topic所占磁盘空间(Kafka 1.0.0)

    很多用户都有这样的需求:实时监控某个topic各分区在broker上所占的磁盘空间大小总和.Kafka并没有提供直接的脚本工具用于统计这些数据. 如果依然要实现这个需求,一种方法是通过监控JMX指标得 ...

  4. Kafka 0.11.0.0 实现 producer的Exactly-once 语义(英文)

    Exactly-once Semantics are Possible: Here’s How Kafka Does it I’m thrilled that we have hit an excit ...

  5. Kafka 1.0.0集群增加节点

    原有环境 主机名 IP 地址 安装路径 系统 sht-sgmhadoopdn-01 172.16.101.58 /opt/kafka_2.12-1.0.0 /opt/kafka(软连接) CentOS ...

  6. Kafka 1.0.0集群安装

    环境 主机名 IP 地址 安装路径 系统 sht-sgmhadoopdn-01 172.16.101.58 /opt/kafka_2.12-1.0.0 /opt/kafka(软连接) CentOS L ...

  7. Kafka: Producer (0.10.0.0)

    转自:http://www.cnblogs.com/f1194361820/p/6048429.html 通过前面的架构简述,知道了Producer是用来产生消息记录,并将消息以异步的方式发送给指定的 ...

  8. Apache Kafka 1.0.0正式发布!

    千呼万唤始出来,经过7年的发展与完善,Apache Kafka 1.0.0正式发布!在笔者看来,比起1.0.0引入的新功能,此版本最大的意义在于标识Kafka各种组件功能的稳定性.不过我们还是来看下1 ...

  9. Kafka版本升级 ( 0.10.0 -> 0.10.2 )

    升级Kafka集群的版本其实很简单,核心步骤只需要4步,但是我们需要在升级的过程中确保每一步操作都不会“打扰”到producer和consumer的正常运转.为此,笔者在本机搭了一个测试环境进行实际的 ...

随机推荐

  1. LoRaWAN 1.1 网络协议规范 - 4 MAC 帧格式 Part II

    LoRaWAN 1.1 网络协议规范 LoRaWAN 1.1 版本封稿很久了也没有完整啃过一遍,最近边啃边翻译,趁着这个机会把它码下来. 如果觉得哪里有问题,欢迎留言斧正. 翻译不易,转载请申明出处和 ...

  2. 模拟页面获取的php数据(三)

    <?php return array( "aData" => [//通勤方式 "trafficType" => [ 0 => [ &qu ...

  3. 查找最大或最小的 N 个元素

    使用内置的heapd模块 In [1]: import heapq In [2]: nums = [1,8, 2, 23, 7, -4, 18, 23, 42, 37, 2] In [3]: prin ...

  4. php快速无限遍历递归文件夹目录、子文件,支持绝对路径和相对路径,支持返回生成数组

    支持无限极遍历子文件及文件夹,支持绝对路径和相对路径! 函数说明:array glob ( string $pattern [, int $flags ] )功能:寻找与模式匹配的文件路径,返回包含匹 ...

  5. 2017-2018-2 1723 『Java程序设计』课程 结对编程练习_四则运算第三周总结

    相关测试过程截图 测试了由中缀表达式转后缀表达式的Junit测试,分别进行了整数的和分数的,测试成功截图 由于生成问题和计算问题中,问题都是随机产生的,暂时不会进行Junit测试,故没有进行,但应是正 ...

  6. 奇怪吸引子---Hadley

    奇怪吸引子是混沌学的重要组成理论,用于演化过程的终极状态,具有如下特征:终极性.稳定性.吸引性.吸引子是一个数学概念,描写运动的收敛类型.它是指这样的一个集合,当时间趋于无穷大时,在任何一个有界集上出 ...

  7. 第十五章 dubbo结果缓存机制

    dubbo提供了三种结果缓存机制: lru:基于最近最少使用原则删除多余缓存,保持最热的数据被缓存 threadlocal:当前线程缓存 jcache:可以桥接各种缓存实现 一.使用方式 <du ...

  8. Android APK反编译详解(附图) (转)

    这段时间在学Android应用开发,在想既然是用Java开发的应该很好反编译从而得到源代码吧,google了一下,确实很简单,以下是我的实践过程. 在此郑重声明,贴出来的目的不是为了去破解人家的软件, ...

  9. ln: creating symbolic link XXXXXX : Operation not supported

    ln: creating symbolic link XXXXXX : Operation not supported 转自:https://blog.csdn.net/z444_579/articl ...

  10. 微软BI 之SSAS 系列 - 多维数据集维度用法之二 事实维度(退化维度 Degenerate Dimension)

    这篇文章是基于上一篇 SSAS 系列 - 多维数据集维度用法之一 引用维度 Referenced Dimension 继续讲解多维数据集维度用法中的事实维度. 事实维度,顾名思义就是把事实表 Fact ...