Kafka客户端性能参数调优

本文介绍了Kafka中生产者和消费者在吞吐量、低延迟、消息持久性和可用性方面的调优技巧,涉及参数如batch.size、linger.ms、compression.type、acks、buffer.memory等,以及针对不同场景的设置建议。
摘要由CSDN通过智能技术生成

调优方向:吞吐量
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减少

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

沉默终止

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值