zoukankan      html  css  js  c++  java
  • Zuul Timeouts

    19.13 Zuul Timeouts

    19.13.1 Service Discovery Configuration

    If Zuul is using service discovery there are two timeouts you need to be concerned with, the Hystrix timeout (since all routes are wrapped in Hystrix commands by default) and the Ribbon timeout. The Hystrix timeout needs to take into account the Ribbon read and connect timeout PLUS the total number of retries that will happen for that service. By default Spring Cloud Zuul will do its best to calculate the Hystrix timeout for you UNLESS you specify the Hystrix timeout explicitly.

    The Hystrix timeout is calculated using the following formula:

    (ribbon.ConnectTimeout + ribbon.ReadTimeout) * (ribbon.MaxAutoRetries + 1) * (ribbon.MaxAutoRetriesNextServer + 1)

    As an example, if you set the following properties in your application properties

    application.yml. 

    ribbon:
      ReadTimeout:100
      ConnectTimeout:500
      MaxAutoRetries:1
      MaxAutoRetriesNextServer:1

    Then the Hystrix timeout (for all routes in this case) will be set to 2400ms.

    [Note]

    You can configure the Hystrix timeout for individual routes using service.ribbon.* properties.

    [Note]

    If you choose to not configure the above properties than the default values will be used therefore the default Hystrix timeout will be set to 4000ms.

    If you set hystrix.command.commandKey.execution.isolation.thread.timeoutInMilliseconds, where commandKey is the route id, or set hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds than these values will be used for the Hystrix timeout regardless of what you have set for the ribbon.* properties. If you set either of these properties YOU are responsible for making sure it takes into account the Ribbon connect and read timeouts as well as any retries that may happen.

    19.13.2 URL Configuration

    If you have configured Zuul routes by specifying URLs than you will need to use zuul.host.connect-timeout-millis and zuul.host.socket-timeout-millis.

    from:http://cloud.spring.io/spring-cloud-static/Edgware.SR3/single/spring-cloud.html#_zuul_timeouts

  • 相关阅读:
    案例5-1.3 整型关键字的散列映射 (25分)--散列表(除留余数法+线性探测法)
    基础实验5-2.2 电话聊天狂人 (25分)-散列表
    习题8.4 畅通工程之最低成本建设问题 (30分)--最小生成树
    练习4.2 平衡二叉树的根 (25分)
    案例7-1.5 与零交换 (25分)--dfs
    习题2.8 输出全排列 (20分)--dfs
    nginx 日志切割
    mysql添加索引
    mysql常见错误码及说明
    MYSQL数据类型分类
  • 原文地址:https://www.cnblogs.com/flying607/p/9202417.html
Copyright © 2011-2022 走看看