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. 17,EasyNetQ-替换EasyNetQ组件

    EasyNetQ是一个由小型组件组成的库. 当你写: var bus = RabbitHutch.CreateBus("host=localhost"); ...静态方法Creat ...

  2. thumbs.db是什么文件

    thumbs.db是什么文件  这是图片缓存文件 Thumbs.db文件是一个数据库,里面保存了这个目录下所有图像文件的缩略图(格式为jpeg) thumbs.db删除不掉 反射获取某个类的 所有字段 ...

  3. C++的多态

    继承.封装.多态是面向对象编程最主要的三个特征,有人说多态是理解C++最难理解的一部分,其实我觉得单单从技术上讲,多态并不难,难的是你需要懂得在何时使用多态,就像封装一样,封装本身不难,难的是你对整个 ...

  4. 使用gulp对js、css、img进行合并压缩

    1 概述 最新使用AngularJS框架做单页面项目,其中包括了很多库的和自已写的js.css.img文件,这些文件都不大,但是数量众多,导致web请求文件过多,一次性加载时比较慢.有尝试过使用异步加 ...

  5. react-native布局篇

    原文链接:http://www.ncloud.hk/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/react-native%E5%B8%83%E5%B1%80/ 一.宽度和 ...

  6. 数据结构C语言版--单链表的基本功能实现

    /* * 构造一个链式存储的线性表(当输入9999时,结束构造过程),然后输出该线性表 * 并统计该线性链表的长度 . *注:new和delete是C++的运算符 malloc和free是C++/C的 ...

  7. 集合(4)—Collection之Set的使用方法

    定义 set接口及其实现类–HashSet Set是元素无序且不可重复的集合,被称为集. HashSet是哈希集,是Set的一个重要实现类 set中循环只能使用foreach和iterator这两个, ...

  8. 实战:mysql统计指定架构的全部表的数据和索引大小情况-v2

    PS:第一个版本号里未做输入的schema_name和table_name推断,改动了一下!再次share! #统计指定架构的全部表的数据和索引大小情况 #tablesize.sh #!/bin/sh ...

  9. c# 以换行(\r\n)拆分字符串

    c# 以换行(\r\n)拆分字符串 字符串数组形式: string[] striparr = strip.Split(new string[] { "\r\n" }, String ...

  10. ARouter原理剖析及手动实现

    ARouter原理剖析及手动实现 前言 路由跳转在项目中用了一段时间了,最近对Android中的ARouter路由原理也是研究了一番,于是就给大家分享一下自己的心得体会,并教大家如何实现一款简易的路由 ...