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.

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

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

Zuul Timeouts的更多相关文章

  1. spring cloud连载第三篇补充之Zuul

    由于Zuul的内容较多所以单独列出一篇来讲.全是干货,如果学到东西的,动动小手给点个推荐^_^  谢谢! 1. Router and Filter: Zuul(路由和过滤:Zuul) 路由是微服务架构 ...

  2. springcloud实践(二)之api网关:zuul

    zuul是什么? front door. API Gateway.Zuul is a JVM based router and server side load balancer by Netflix ...

  3. Zuul 超时设置

    问题描述 使用 Zuul 作为网关,偶发超时问题及第一次调用触发熔断问题 解决方案 超时问题 ribbon: ReadTimeout: 10000 SocketTimeout: 60000 第一次调用 ...

  4. Netflix Zuul 了解

    Zuul 是提供动态路由,监控,弹性,安全等的边缘服务.Zuul 相当于是设备和 Netflix 流应用的 Web 网站后端所有请求的前门.Zuul 可以适当的对多个 Amazon Auto Scal ...

  5. netflix zuul 学习

    netflix zuul 是netflix开发的一个EDGE SERVICE. 主要是作为一个API Gateway 服务器,可以实现安全,流量控制等功能. 我看的是1.x的版本,Zuul1.x的实现 ...

  6. SpringCloud网关ZUUL集成consul

    最近一直在搞基于springcloud的微服务开发,为了不限定微服务开发语言,服务发现决定采用consul不多说上代码 pom文件 <project xmlns="http://mav ...

  7. springcloud(十):服务网关zuul

    前面的文章我们介绍了,Eureka用于服务的注册于发现,Feign支持服务的调用以及均衡负载,Hystrix处理服务的熔断防止故障扩散,Spring Cloud Config服务集群配置中心,似乎一个 ...

  8. Spring REST 与 Zuul 代理

    http://www.baeldung.com/spring-rest-with-zuul-proxy 作者: Eugen Paraschiv 译者: http://oopsguy.com 1.概述 ...

  9. Zuul(SpringCloud学习笔记一)

    路由是微服务架构中必须(integral )的一部分,比如,"/" 可能映射到你的WEB程序上,"/api/users "可能映射到你的用户服务上," ...

随机推荐

  1. django外键以及主表和子表的相互查询

    Django的外键使用 from django.db import models # Create your models here. class Category(models.Model): na ...

  2. you have mixed tabs and spaces fix this

    http://blog.csdn.net/tonyyan19781/article/details/60882443 Vs2013 IDE下,编辑C++的工程源码,在打开文件的时候,会出现 " ...

  3. 如何在Windows版的ScaleIO的节点中添加磁盘

    嗯, 为什么会有这个问题呢? 因为我要安装ScaleIO 1.32, 在使用Installation manager完成初始安装之后, 需要将一些磁盘添加到ScaleIO的storage pool中. ...

  4. https://www.cnblogs.com/xubing-613/p/5895948.html

    最近总是需要用matplotlib绘制一些图,由于是新手,所以总是需要去翻书来找怎么用,即使刚用过的,也总是忘.所以,想写一个入门的教程,一方面帮助我自己熟悉这些函数,另一方面有比我还小白的新手可以借 ...

  5. Tensorflow-3-使用RNN生成中文小说

    https://blog.csdn.net/heisejiuhuche/article/details/73010638 这篇文章不涉及RNN的基本原理,只是从选择数据集开始,到最后生成文本,展示一个 ...

  6. Python练习环境搭建-引入预定义数据

    学习Python,有大量的需要在交互式环境下练习的项目,这时数据来源就很麻烦了,手工输入太慢,写到程序中,运行方便,但各种实验又不方便.昨天试了半天也无法从vscode完美地跳出到交互环境. 今天反过 ...

  7. border-color: transparent rgb(255, 48, 48) transparent transparent;

    border-color: transparent rgb(255, 48, 48) transparent transparent;

  8. 用 CSS 实现元素垂直居中,有哪些好的方案?

    1.不知道自己高度和父容器高度的情况下, 利用绝对定位只需要以下三行: parentElement{ position:relative; } childElement{ position: abso ...

  9. (C++)关于拷贝构造函数 Copy Constructor

    题目: In which of the following scenarios is a Copy Constructor called or invoked? A.    When no conve ...

  10. pdo_mysql安装不了或是安装后用不了的修复教程

    目前发现wdOS及lanmp_wdcp的RPM包安装在部分系统下安装后,在安装pdo_mysql时无法安装或安装后无法使用的问题 如在安装时提示下如下 regenerate PHP parsers.c ...