该警告是在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