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.
![]() |
|
You can configure the Hystrix timeout for individual routes using |
![]() |
|
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 |
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的更多相关文章
- spring cloud连载第三篇补充之Zuul
由于Zuul的内容较多所以单独列出一篇来讲.全是干货,如果学到东西的,动动小手给点个推荐^_^ 谢谢! 1. Router and Filter: Zuul(路由和过滤:Zuul) 路由是微服务架构 ...
- springcloud实践(二)之api网关:zuul
zuul是什么? front door. API Gateway.Zuul is a JVM based router and server side load balancer by Netflix ...
- Zuul 超时设置
问题描述 使用 Zuul 作为网关,偶发超时问题及第一次调用触发熔断问题 解决方案 超时问题 ribbon: ReadTimeout: 10000 SocketTimeout: 60000 第一次调用 ...
- Netflix Zuul 了解
Zuul 是提供动态路由,监控,弹性,安全等的边缘服务.Zuul 相当于是设备和 Netflix 流应用的 Web 网站后端所有请求的前门.Zuul 可以适当的对多个 Amazon Auto Scal ...
- netflix zuul 学习
netflix zuul 是netflix开发的一个EDGE SERVICE. 主要是作为一个API Gateway 服务器,可以实现安全,流量控制等功能. 我看的是1.x的版本,Zuul1.x的实现 ...
- SpringCloud网关ZUUL集成consul
最近一直在搞基于springcloud的微服务开发,为了不限定微服务开发语言,服务发现决定采用consul不多说上代码 pom文件 <project xmlns="http://mav ...
- springcloud(十):服务网关zuul
前面的文章我们介绍了,Eureka用于服务的注册于发现,Feign支持服务的调用以及均衡负载,Hystrix处理服务的熔断防止故障扩散,Spring Cloud Config服务集群配置中心,似乎一个 ...
- Spring REST 与 Zuul 代理
http://www.baeldung.com/spring-rest-with-zuul-proxy 作者: Eugen Paraschiv 译者: http://oopsguy.com 1.概述 ...
- Zuul(SpringCloud学习笔记一)
路由是微服务架构中必须(integral )的一部分,比如,"/" 可能映射到你的WEB程序上,"/api/users "可能映射到你的用户服务上," ...
随机推荐
- [转]linux最新分区方案
FROM : http://www.cnblogs.com/chenlulouis/archive/2009/08/27/1554983.html 我的服务器是500G.最重要的是/var分区一定要大 ...
- scala编程第16章学习笔记(3)——List类的高阶方法
列表间映射:map.flatMap和foreach 1.xs map f 操作返回把函数f应用在xs的每个列表元素之后由此组成的新列表.如: scala> List(1, 2, 3) map ( ...
- matlib常用知识
把文件装入矩阵 x = load('ex4x.dat'); y = load('ex4y.dat'); [m, n] = size(x); %得到矩阵x的行数和列数 ex4x.dat共80行,2列,通 ...
- B/S架构中常用弹出方法 (转)
<一> 在B/S架构的项目中,为了提高项目的易用性,增强系统与用户的交互功能,一般使用弹出页面来为用户提供操作或数据选择帮助信息,比如,用户输入一个编码中某些字符,在弹出页面中显示所有包含 ...
- 说说最易被忽略的CSS强制性换行
一般情况下,元素拥有默认的white-space:normal(自动换行,PS:不换行是white-space:nowrap),当录入的文字超过定义的宽度后会自动换行,但当录入的数据是一堆没有空格的字 ...
- IOS中的网络编程详解
在移动互联网时代,几乎所有应用都需要用到网络,比如QQ.微博.网易新闻.优酷.百度地图,只有通过网络跟外界进行数据交互.数据更新,应用才能保持新鲜.活力,如果没有了网络,也就缺少了数据变化,无论外观多 ...
- 仿qq底部的提示标记
看到一个比較不错的开源项目,分享给大家: <?xml version="1.0" encoding="utf-8"?> <RelativeLa ...
- 定时删除日志文件---linux定时清理日志
linux是一个很能自动产生文件的系统,日志.邮件.备份等.虽然现在硬盘廉价,我们可以有很多硬盘空间供这些文件浪费,让系统定时清理一些不需要的文件很有一种爽快的事情.不用你去每天惦记着是否需要清理日志 ...
- 【Spark】开发Spark选择Java还是Scala?
Spark-Java-Scala-哪种语言 spark java 支持_百度搜索 (1 封私信)Spark 中用 Scala 和 java 开发有什么区别? - 知乎 (1 封私信)Spark平台下, ...
- PHP ECSHOP中 诡异的问题:expects parameter 1 to be double
使用Ecshop给客户做了一个商城系统,在测试时发现后台在更改订单的配送方式时出现了以下问题 "PHP Warning: number_format() expects parameter ...
