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. JS的prototype和__proto__(含es6的class)

    JS的prototype和__proto__(含es6的class) 一.prototype和__proto__的概念 prototype是函数的一个属性(每个函数都有一个prototype属性),这 ...

  2. Python学习——迭代器&生成器&装饰器

    一.迭代器 迭代器是访问集合元素的一种方式.迭代器对象从集合的第一个元素开始访问,直到所有的元素被访问完结束.迭代器只能往前不会后退迭代器的一大优点是不要求事先准备好整个迭代过程中所有的元素.迭代器仅 ...

  3. 潭州课堂25班:Ph201805201 并发(非阻塞,epoll) 第十课 (课堂笔记)

    # -*- coding: utf-8 -*- # 斌彬电脑 # @Time : 2018/7/12 0012 20:29 import socket server = socket.socket() ...

  4. BeautifulSoup库的使用方法

    from bs4 import BeautifulSoup import lxml html = ''' <html><head><title>The Dormou ...

  5. 在web中实现当前变量和前一个的比较

    /*if (attribute == null) {// 如果缓存中没有存过UploadTimeObj对象,那么创建对象,并将该对象存入缓存中                    UploadTim ...

  6. 分布式理论——从ACID到CAP再到BASE

    在传统的数据中,有ACID四大原则,在分布式中也有对应的CAP理论和BASE理论,这些都是分布式理论的基础. 更多内容参考:大数据学习之路 ACID ACID分别是Atomicity 原子性.Cons ...

  7. Redis集群简记

    Redis集群 http://doc.redisfans.com/topic/cluster-tutorial.html redis 集群是为了多个节点之间数据的共享和集群高可用的保证. redis ...

  8. JAVA在Windows使用apache commons-csv导出CSV解决方案

    一.添加依赖到pom.xml <!-- https://mvnrepository.com/artifact/commons-io/commons-io --> <dependenc ...

  9. wzoj install

    wzoj/wiki/安装指南 wzoj-judger/wiki/安装指南 安装LAMP环境 如果你不知道如何安装:DebianUbuntuArchRed Hat 安装redis缓存系统 在 Ubunt ...

  10. What's the difference between ConcurrentHashMap and Collections.synchronizedMap(Map)?

    来自:http://stackoverflow.com/questions/510632/whats-the-difference-between-concurrenthashmap-and-coll ...