The Hystrix timeout of 60000ms for the command service-basic is set lower than the combination of the Ribbon read and connect timeout, 240000ms。
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=60000
#请求处理的超时时间,单位为毫秒
ribbon.ReadTimeout=60000
#请求连接的超时时间,单位为毫秒
ribbon.ConnectTimeout=60000
#对当前实例的重试次数,默认为0
ribbon.MaxAutoRetries=0
#切换实例的重试次数,默认为0
ribbon.MaxAutoRetriesNextServer=1
我原本的配置为:
这句话的意思是:你熔断器(Hystrix )的时间小于,负载均衡(Ribbon )的超时时间了
具体的超时时间排序应该为:
具体服务的hytrix超时时间 > 默认的hytrix超时时间 > ribbon超时时间
其中ribbon的计算方法为:
ribbonTimeout = (60000 + 60000) * (0 + 1) * (1 + 1) = 240000
所以如果默认的或者具体服务的hytrix超时时间小于ribbon超时时间就会警告
将Hystrix超时时间设置超过240000即可。
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=1800000
#请求处理的超时时间,单位为毫秒
ribbon.ReadTimeout=60000
#请求连接的超时时间,单位为毫秒
ribbon.ConnectTimeout=60000
#对当前实例的重试次数,默认为0
ribbon.MaxAutoRetries=0
#切换实例的重试次数,默认为0
ribbon.MaxAutoRetriesNextServer=1