关于kafka消费慢的一次记录

背景:

多个生产者组向kafka发送消息,每个生产者每次发送消息数量不定。消费者收到消息后进行判断后写文件。

事件:

程序日志中时不时出现:

Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing the session timeout or by reducing the maximum size of batches returned in poll() with max.poll.records. 

原因 :

原因很明显就是由于消费能力跟不上,导致了kafka消息积压,查看积压情况,十分严重

分析: 

只是简单的判断和写文件,没有复杂的业务逻辑,不应该消费慢啊?

1、想到会不会是由于只有两个分区,生产者的key相同消息只分发到一个分区中导致积压呢?查看发送消息的代码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值