Kafka客户端性能参数调优

调优方向:吞吐量

Producer:

• batch.size: increase to 100000--200000 (default 16384)

linger.ms: increase to 10--100 (default 0)

• compression.type=lz4 (default none, i.e., no compression)

• acks=1 (default 1)

• buffer.memory: increase if there are a lot of partitions (default 33554432)

Consumer:

• fetch.min.bytes: increase to ~100000 (default 1)
调优方向:低延迟

Producer:

• linger.ms=0 (default 0)

• compression.type=none (default none, i.e., no compression)

• acks=1 (default 1)

Consumer:

• fetch.min.bytes=1 (default 1)
调优方向:持久性(消息不丢失

replication.factor=3

• acks=all (default 1)

• enable.idempotence=true (default false), to prevent duplicate messages and out-of-order

messages

• max.in.flight.requests.per.connection=1 (default 5), to prevent out of order messages

when not using an idempotent producer

Consumer:

• enable.auto.commit=false (default true)

• isolation.level=read_committed (when using EOS transactions)

调优方向:可用性

Consumer:

session.timeout.ms: increase (default 10000)

max.poll.records减少

相关推荐
DemonAvenger2 天前
Kafka性能调优:从参数配置到硬件选择的全方位指南
性能优化·kafka·消息队列
初次攀爬者2 天前
ZooKeeper 实现分布式锁的两种方式
分布式·后端·zookeeper
yumgpkpm4 天前
AI视频生成:Wan 2.2(阿里通义万相)在华为昇腾下的部署?
人工智能·hadoop·elasticsearch·zookeeper·flink·kafka·cloudera
予枫的编程笔记4 天前
【Kafka高级篇】避开Kafka原生重试坑,Java业务端自建DLQ体系,让消息不丢失、不积压
java·kafka·死信队列·消息中间件·消息重试·dlq·java业务开发
倚肆4 天前
在 Windows Docker 中安装 Kafka 并映射 Windows 端口
docker·kafka
断手当码农4 天前
Redis 实现分布式锁的三种方式
数据库·redis·分布式
Sheffield4 天前
如果把ZooKeeper按字面意思比作动物园管理员……
elasticsearch·zookeeper·kafka
初次攀爬者4 天前
Redis分布式锁实现的三种方式-基于setnx,lua脚本和Redisson
redis·分布式·后端
雪碧聊技术4 天前
kafka的下载、安装、启动
kafka