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

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

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)

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

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

 

相关文章:

  • 2022-12-23
  • 2021-08-29
  • 2022-01-18
  • 2021-06-16
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-07
  • 2021-06-28
  • 2021-08-30
  • 2021-09-07
  • 2022-12-23
相关资源
相似解决方案