每次轮询之间的延迟时间是多少 [英] What is the delay time between each poll

查看:698
本文介绍了每次轮询之间的延迟时间是多少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在kafka文档中,我试图了解此属性 max.poll.interval.ms

In kafka documentation i'm trying to understand this property max.poll.interval.ms

使用使用者组管理时,调用poll()之间的最大延迟.这为使用者在获取更多记录之前可以处于空闲状态的时间设置了上限.如果在此超时到期前未调用poll(),则认为使用方失败,该组将重新平衡以将分区重新分配给另一个成员.

The maximum delay between invocations of poll() when using consumer group management. This places an upper bound on the amount of time that the consumer can be idle before fetching more records. If poll() is not called before expiration of this timeout, then the consumer is considered failed and the group will rebalance in order to reassign the partitions to another member.

这意味着每次轮询将在poll-time-out之前进行,默认情况下为5分钟.所以我的问题是使用者线程在两次连续的轮询之间花费了多少时间?

This mean each poll will happen before the poll-time-out by default it is 5 minutes. So my question is exactly how much time consumer thread takes between two consecutive polls?

例如:使用者线程1

第一次民意测验->有100条记录 ->处理100条记录(耗时1分钟) ->消费者提交的抵消额

First poll--> with 100 records --> process 100 records (took 1 minute) --> consumer submitted offset

第二次投票->具有100条记录 ->处理100条记录(耗时1分钟) ->消费者提交的抵消额

Second poll--> with 100 records --> process 100 records (took 1 minute) --> consumer submitted offset

消费者在第一次和第二次投票之间花费时间吗?如果是,为什么?以及我们该如何更改时间(当主题中包含大量数据时可以假设这一点)

Does consumer take time between first and second poll? if yes, why? and how can we change that time ( assume this when topic has huge data)

推荐答案

目前尚不清楚间隔时间"是什么意思;如果您正在谈论spring-kafka侦听器容器,那么这就是您的意思,那么就无需等待或休眠.

It's not clear what you mean by "take time between"; if you are talking about the spring-kafka listener container, there is no wait or sleep, if that's what you mean.

在提交偏移量后立即对消费者进行轮询.

The consumer is polled immediately after the offsets are committed.

因此,max.poll.interval.ms必须足够大,以使您的听众可以处理max.poll.records(以防万一,还有一些额外的内容).

So, max.poll.interval.ms must be large enough for your listener to process max.poll.records (plus some extra, just in case).

但是,不,轮询之间没有添加任何延迟,只是侦听器处理轮询结果所花费的时间.

But, no, there are no delays added between polls, just the time it takes the listener to handle the results of the poll.

这篇关于每次轮询之间的延迟时间是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆