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. Java 复习

    基础: JAVA基础扎实,理解io.多线程.集合等基础框架,对JVM原理有一定的了解: 熟读Java SDK源码: 框架: 对Spring,ibatis,struts等开源框架熟悉:

  2. C语言中常用的字符串操作函数

    程序开头要声明 #include <string.h> 函数名: stpcpy 功 能: 拷贝一个字符串到另一个 用 法: char *stpcpy(char *destin, char ...

  3. NOIP 竞赛注意事项

    <一>程序习惯注意 一.Linux与Windows的区别 a) 大小写敏感 i.   在Windows下,文件名大小写不敏感,例如A.c 与 a.c 与和a.C与A.C和没有区别. ii. ...

  4. angular2项目关于Echarts图表的处理

    在NiceFish项目中关于Echarts组件和指令是直接注册在appModule根模块中的,这样路由只需这样写就可以让浏览器加载图标组件: 在chart组件视图中: <div class=&q ...

  5. Codeforces Round #407 div2 题解【ABCDE】

    Anastasia and pebbles 题意:你有两种框,每个框可以最多装k重量的物品,但是你每个框不能装不一样的物品.现在地面上有n个物品,问你最少多少次,可以把这n个物品全部装回去. 题解:其 ...

  6. SimpleDateFormat 格式化参数说明

    字母 日期或时间元素 表示 示例 G Era 标志符 Text AD y 年 Year 1996; 96 M 年中的月份 Month July; Jul; 07 w 年中的周数 Number 27 W ...

  7. 【转】Intellij IDEA调试功能

    http://www.cnblogs.com/winner-0715/p/5422952.html 先编译好要调试的程序.1.设置断点

  8. 编码原则:最小化使用控制结构(条件和循环)续:告别 break 和 continue

    如果最小化的使用了for.while等控制结构,那么,之前控制结构对应的两个控制语句(break he continue)也需要有对应的替换方案,好在几乎所有支持高阶函数的语言的集合API都有支持.

  9. 深入学习 FutureTask

    原文出处: 天凉好个秋 第一部分:What 在Java中一般通过继承Thread类或者实现Runnable接口这两种方式来创建多线程,但是这两种方式都有个缺陷,就是不能在执行完成后获取执行的结果,因此 ...

  10. Next Permutation leetcode java

    题目: Implement next permutation, which rearranges numbers into the lexicographically next greater per ...