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


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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM