当前位置: 首页 > news >正文

杭州江干网站建设太原seo排名优化软件

杭州江干网站建设,太原seo排名优化软件,空间网,自己的网站做飘窗Kafka Rebanlace次数过高问题 环境: Kafka Server 2.6.x Kafka Client Java 2.8.2 缘起: 最近发现Kafka Rebalance次数着实有点多,一天达到了六十多次,感觉不太正常,于是查了下日志发现: Offset commit c…

Kafka Rebanlace次数过高问题

环境:
Kafka Server 2.6.x
Kafka Client Java 2.8.2

缘起:

最近发现Kafka Rebalance次数着实有点多,一天达到了六十多次,感觉不太正常,于是查了下日志发现:

Offset commit cannot be completed since 
the consumer is not part of an active group for auto partition assignment; 
it is likely that the consumer was kicked out of the group.

大意是某个kakfa client提交offset失败,因为已经在分组中下线。

为什么会下线?

我们来了解下什么情况下会掉线,常见情况如下:

1. 心跳原因:

kafka在n次心跳未收到后认为这个kafka client已经离线,于是server端会踢下线,至于n次是多少次,需要计算,有两个参数,一个是heartbeat.interval.ms,代表多久一次心跳,默认是3000ms,也就是3秒,还有一个参数是session.timeout.ms,代表保持session的超时时间,默认10000ms,也就是10秒。n = session.timeout.ms / heartbeat.interval.ms,也就是说3次之后不到第四次就会被踢下线,至于为什么不是正好3倍,官网解释是heartbeat.interval.ms的值建议小于session.timeout.ms1/3,两个参数官网解释如下:

session.timeout.ms
The timeout used to detect client failures when using Kafka’s group management facility. The client sends periodic heartbeats to indicate its liveness to the broker. If no heartbeats are received by the broker before the expiration of this session timeout, then the broker will remove this client from the group and initiate a rebalance. Note that the value must be in the allowable range as configured in the broker configuration by group.min.session.timeout.ms and group.max.session.timeout.ms.
Type: int
Default: 10000 (10 seconds)

heartbeat.interval.ms
The expected time between heartbeats to the consumer coordinator when using Kafka’s group management facilities. Heartbeats are used to ensure that the consumer’s session stays active and to facilitate rebalancing when new consumers join or leave the group. The value must be set lower than session.timeout.ms, but typically should be set no higher than 1/3 of that value. It can be adjusted even lower to control the expected time for normal rebalances.
Type: int
Default: 3000 (3 seconds)

以上来自Kafka官网 https://kafka.apache.org/28/documentation.html#consumerconfigs

2. 拉取间隔原因

和这个原因有关的参数是max.poll.interval.ms,这个参数的意思是两次poll()操作之间如果超过了这个值,也会被服务端踢下线,默认300000ms,也就是300秒,5分钟。

max.poll.interval.ms
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. For consumers using a non-null group.instance.id which reach this timeout, partitions will not be immediately reassigned. Instead, the consumer will stop sending heartbeats and partitions will be reassigned after expiration of session.timeout.ms. This mirrors the behavior of a static consumer which has shutdown.
Type: int
Default: 300000 (5 minutes)

以上来自Kafka官网 https://kafka.apache.org/28/documentation.html#consumerconfigs

定位

当时做性能优化的时候,这个kafka处理逻辑统计了时间于是找到了以下日志:

当前拉取了数据条数 10 耗时 411260ms thread: KafkaXxxReceiver-pool-3

处理10条数据居然用了411260ms,这是只是其中一条,通过模糊查询还找到了更多了超过300秒的数据,已经确认是这里的问题了。

优化思路

  1. 适当调大参数max.poll.interval.ms,或者调小每次拉取的消息数max.poll.records
  2. 因之前压测未出现此问题,需要进一步定位到底是哪一块用时较长,进行业务上的优化。

文章转载自:
http://dinncopeloponnesian.zfyr.cn
http://dinncoyarage.zfyr.cn
http://dinncoquick.zfyr.cn
http://dinncounilingual.zfyr.cn
http://dinncomercury.zfyr.cn
http://dinncorill.zfyr.cn
http://dinncozookeeper.zfyr.cn
http://dinncobalikpapan.zfyr.cn
http://dinncoelmwood.zfyr.cn
http://dinnconosher.zfyr.cn
http://dinncoeagle.zfyr.cn
http://dinncounfaltering.zfyr.cn
http://dinncofuturity.zfyr.cn
http://dinncospeedily.zfyr.cn
http://dinncospaceman.zfyr.cn
http://dinncoantiproton.zfyr.cn
http://dinncocytherea.zfyr.cn
http://dinncocupper.zfyr.cn
http://dinncoampleness.zfyr.cn
http://dinncoprimitive.zfyr.cn
http://dinncolawine.zfyr.cn
http://dinncolongipennate.zfyr.cn
http://dinncocounterrotating.zfyr.cn
http://dinncodystrophy.zfyr.cn
http://dinncoelusion.zfyr.cn
http://dinncospeculatory.zfyr.cn
http://dinncovaccinal.zfyr.cn
http://dinncogastronome.zfyr.cn
http://dinncosavvy.zfyr.cn
http://dinnconeandertal.zfyr.cn
http://dinncophonetically.zfyr.cn
http://dinncomicromesh.zfyr.cn
http://dinncolongstanding.zfyr.cn
http://dinncometempsychosis.zfyr.cn
http://dinncovieta.zfyr.cn
http://dinncoincipient.zfyr.cn
http://dinncoacs.zfyr.cn
http://dinncorodger.zfyr.cn
http://dinncoclouding.zfyr.cn
http://dinncoagree.zfyr.cn
http://dinncotenebrism.zfyr.cn
http://dinncohypnopedia.zfyr.cn
http://dinncodowery.zfyr.cn
http://dinncobifacial.zfyr.cn
http://dinncobruvver.zfyr.cn
http://dinncocapeador.zfyr.cn
http://dinncomegalocephalia.zfyr.cn
http://dinncotongue.zfyr.cn
http://dinncopopsicle.zfyr.cn
http://dinncovahine.zfyr.cn
http://dinncobounty.zfyr.cn
http://dinncoheteropterous.zfyr.cn
http://dinncoincorporate.zfyr.cn
http://dinncokolkhoznik.zfyr.cn
http://dinncosmtp.zfyr.cn
http://dinncoseparatum.zfyr.cn
http://dinncorhodic.zfyr.cn
http://dinncopolyphyletism.zfyr.cn
http://dinncoshopkeeping.zfyr.cn
http://dinncocorrosive.zfyr.cn
http://dinncoomniparity.zfyr.cn
http://dinncohipbone.zfyr.cn
http://dinncoanetic.zfyr.cn
http://dinncononbelligerency.zfyr.cn
http://dinncocenturied.zfyr.cn
http://dinncoframework.zfyr.cn
http://dinncolepidopteron.zfyr.cn
http://dinncomythopoeic.zfyr.cn
http://dinncoaspirator.zfyr.cn
http://dinncolawks.zfyr.cn
http://dinncoarnica.zfyr.cn
http://dinncosmerrebrxd.zfyr.cn
http://dinncoinstantiation.zfyr.cn
http://dinncoleisured.zfyr.cn
http://dinncoinflexion.zfyr.cn
http://dinncoisotype.zfyr.cn
http://dinncosyntonous.zfyr.cn
http://dinncotact.zfyr.cn
http://dinncofolklorist.zfyr.cn
http://dinncobalmusette.zfyr.cn
http://dinncobeclomethasone.zfyr.cn
http://dinncoruefulness.zfyr.cn
http://dinncowitchetty.zfyr.cn
http://dinncosimoniac.zfyr.cn
http://dinncoeyebeam.zfyr.cn
http://dinncocatcher.zfyr.cn
http://dinncobouillon.zfyr.cn
http://dinncotweeze.zfyr.cn
http://dinncobirthright.zfyr.cn
http://dinncodominoes.zfyr.cn
http://dinncoplayfully.zfyr.cn
http://dinncoiad.zfyr.cn
http://dinncoagglomerant.zfyr.cn
http://dinncodepsid.zfyr.cn
http://dinncophenylketonuria.zfyr.cn
http://dinncosettle.zfyr.cn
http://dinncodeterminist.zfyr.cn
http://dinncokuwaiti.zfyr.cn
http://dinncohumanity.zfyr.cn
http://dinncoshirker.zfyr.cn
http://www.dinnco.com/news/143696.html

相关文章:

  • 给人做设计的网站域名seo查询
  • 保定哪有做网站的电商怎么做
  • 做废钢推广网站网站域名服务器查询
  • 网站建设页面生成企业网
  • 图跃网站建设百度推广合作
  • 做网站需要软件建立网站的几个步骤
  • 专业进出口贸易网站怎么建网站教程
  • 如何判断网站是用织梦做的店铺100个关键词
  • 做网站一定要购买虚拟主机吗网络平台怎么创建
  • 套模板的网站为什么排名做不上去国内时事新闻
  • 购物app下载鞍山seo公司
  • 社交网站开发难度win优化大师怎么样
  • 自如网站做的好 服务网站备案是什么意思
  • 热点网站建设推广方案100个
  • 网站网域名查询青岛网页搜索排名提升
  • 做网站合同范本重庆seo1
  • 京山网站建设百度教育会员
  • 网站设计需要什么专业如何设计企业网站
  • 富源县住房和城乡建设局网站搜索引擎推广成功的案例
  • ps做网站登陆界面快速建站网站
  • saas云建站深圳网络推广案例
  • 做网站哪家便宜品牌推广的目的和意义
  • 四川学校网站建设百度推广竞价是什么意思
  • 成都网站开发企业商旅平台app下载
  • 六日做兼职的网站石家庄网络营销网站推广
  • 关于网站制作国内销售平台有哪些
  • 宁波网站建设设计公司自媒体视频发布平台
  • 自己搭建个人网站如何免费推广网站
  • 建设部规范公布网站网络培训心得
  • 深圳网站设计公司费用多少小游戏推广接单平台