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减少

相关推荐
掘金-我是哪吒13 分钟前
分布式微服务系统架构第155集:JavaPlus技术文档平台日更-Java线程池实现原理
java·分布式·微服务·云原生·架构
Bug退退退12310 小时前
RabbitMQ 高级特性之死信队列
java·分布式·spring·rabbitmq
prince0511 小时前
Kafka 生产者和消费者高级用法
分布式·kafka·linq
菜萝卜子12 小时前
【Project】基于kafka的高可用分布式日志监控与告警系统
分布式·kafka
csdn_aspnet12 小时前
在 Windows 上安装和运行 Apache Kafka
windows·kafka
幼稚园的山代王19 小时前
RabbitMQ 4.1.1初体验-队列和交换机
分布式·rabbitmq·ruby
小新学习屋19 小时前
Spark从入门到熟悉(篇三)
大数据·分布式·spark
沉着的码农1 天前
【设计模式】基于责任链模式的参数校验
java·spring boot·分布式
ZHOU_WUYI1 天前
一个简单的分布式追踪系统
分布式
码不停蹄的玄黓2 天前
MySQL分布式ID冲突详解:场景、原因与解决方案
数据库·分布式·mysql·id冲突