首页 > 其他 > 详细

The Hystrix timeout of 2000ms for the command xxx is set lower than the combination of the Ribbon read and connect timeout, 4000ms.

时间:2019-12-31 17:56:03      阅读:117      评论:0      收藏:0      [点我收藏+]

该警告是在org.springframework.cloud.netflix.zuul.filters.route.support.AbstractRibbonCommand类的getHystrixTimeout方法中输出的,意思是断路器(Hystrix)设置的超时时间要比Ribbon设置的超时时间短。

技术分享图片

hystrix超时设置:

hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds = 6000  # 默认超时时间
hystrix.command.xxx.execution.isolation.thread.timeoutInMilliseconds = 6000      # 具体应用的超时时间

 

ribbon超时时间计算:ribbonTimeout = (ribbonReadTimeout + ribbonConnectTimeout) * (maxAutoRetries + 1) * (maxAutoRetriesNextServer + 1)

技术分享图片

ribbon全局设置,超时时间:(2000+1000)*(0+1)*(1+1)=6000:

ribbon.ReadTimeout = 2000            # 访问超时,单位毫秒,默认1000
ribbon.ConnectTimeout = 1000         # 连接超时,单位毫秒,默认1000
ribbon.MaxAutoRetries = 0            # 最大重试次数,默认0
ribbon.MaxAutoRetriesNextServer = 1  # 最大重试服务个数,默认1

ribbon针对具体服务设置,超时时间:(3000+1000)*(0+1)*(0+1)=4000:

zk-provider.ribbon.ReadTimeout = 3000
zk-provider.ribbon.ConnectTimeout = 1000
zk-provider.ribbon.MaxAutoRetries = 0
zk-provider.ribbon.MaxAutoRetriesNextServer = 0

 

The Hystrix timeout of 2000ms for the command xxx is set lower than the combination of the Ribbon read and connect timeout, 4000ms.

原文:https://www.cnblogs.com/zhi-leaf/p/12125392.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!