HystrixCommandProperties命令执行相关配置:

  hystrix.command.[commandkey].execution.isolation.strategy 隔离策略THREAD或SEMAPHORE 默认HystrixCommands使用THREAD方式 HystrixObservableCommands使用SEMAPHORE

  hystrix.command.[commandkey].execution.timeout.enabled 是否开启超时设置,默认true。

  hystrix.command.[commandkey].execution.isolation.thread.timeoutInMilliseconds 默认超时时间 默认1000ms

  hystrix.command.[commandkey].execution.isolation.thread.interruptOnTimeout是否打开超时线程中断 默认值true

  hystrix.command.[commandkey].execution.isolation.thread.interruptOnFutureCancel 当隔离策略为THREAD时,当执行线程执行超时时,是否进行中断处理,即Future#cancel(true)处理,默认为false。

  hystrix.command.[commandkey].execution.isolation.semaphore.maxConcurrentRequests 信号量最大并发度 默认值10该参数当使用ExecutionIsolationStrategy.SEMAPHORE策略时才有效。如果达到最大并发请求数,请求会被拒绝。理论上选择semaphore size的原则和选择thread size一致,但选用semaphore时每次执行的单元要比较小且执行速度快(ms级别),否则的话应该用thread。

  hystrix.command.[commandkey].fallback.isolation.semaphore.maxConcurrentRequests fallback方法的信号量配置,配置getFallback方法并发请求的信号量,如果请求超过了并发信号量限制,则不再尝试调用getFallback方法,而是快速失败,默认信号量为10。

  hystrix.command.[commandkey].fallback.enabled 是否启用降级处理,如果启用了,则在超时或异常时调用getFallback进行降级处理,默认开启。

  hystrix.command.[commandkey].circuitBreaker.enabled 是否开启熔断机制,默认为true。

  hystrix.command.[commandkey].circuitBreaker.forceOpen 强制开启熔断,默认为false。

  hystrix.command.[commandkey].circuitBreaker.forceClosed 强制关闭熔断,默认为false。

  hystrix.command.[commandkey].circuitBreaker.sleepWindowInMilliseconds  熔断窗口时间,默认为5s。

  hystrix.command.[commandkey].circuitBreaker.requestVolumeThreshold 当在配置时间窗口内达到此数量后的失败,进行短路。默认20个

  hystrix.command.[commandkey].circuitBreaker.errorThresholdPercentage 出错百分比阈值,当达到此阈值后,开始短路。默认50%

  hystrix.command.[commandkey].metrics.rollingStats.timeInMilliseconds   设置统计滚动窗口的长度,以毫秒为单位。用于监控和熔断器 默认10s

  hystrix.command.[commandkey].metrics.rollingStats.numBuckets  设置统计窗口的桶数量 默认10

  hystrix.command.[commandkey].metrics.rollingPercentile.enabled 设置执行时间是否被跟踪,并且计算各个百分比,50%,90%等的时间 默认true

  hystrix.command.[commandkey].metrics.rollingPercentile.timeInMilliseconds 设置执行时间在滚动窗口中保留时间,用来计算百分比 默认60000ms

  hystrix.command.[commandkey].metrics.rollingPercentile.numBuckets 设置rollingPercentile窗口的桶数量 默认6。

  hystrix.command.[commandkey].metrics.rollingPercentile.bucketSize 此属性设置每个桶保存的执行时间的最大值 默认100。如果bucket size=100,window=10s,若这10s里有500次执行,只有最后100次执行会被统计到bucket里去。增加该值会增加内存开销以及排序的开销。

  hystrix.command.[commandkey].metrics.healthSnapshot.intervalInMilliseconds 记录health 快照(用来统计成功和错误绿)的间隔,默认500ms

  hystrix.command.[commandkey].requestCache.enabled 设置是否缓存请求,request-scope内缓存 默认值true

  hystrix.command.[commandkey].requestLog.enabled 设置HystrixCommand执行和事件是否打印到HystrixRequestLog中 默认值true

  hystrix.command.[commandkey].threadPoolKeyOverride   命令的线程池key,决定该命令使用哪个线程池。

HystrixThreadPoolProperties线程池相关配置:

  hystrix.threadpool.[threadkey].coreSize 线程池核心线程数 默认值10;

  hystrix.threadpool.[threadkey].maximumSize  线程池最大线程数 默认值10;

  hystrix.threadpool.[threadkey].allowMaximumSizeToDivergeFromCoreSize   当线程数大于核心线程数时,是否需要回收。与keepAliveTimeMinutes配合使用。

  hystrix.threadpool.[threadkey].keepAliveTimeMinutes  当实际线程数超过核心线程数时,线程存活时间 默认值1min

  hystrix.threadpool.[threadkey].maxQueueSize  最大等待队列数 默认不开启使用SynchronousQueue 不可动态调整

  hystrix.threadpool.[threadkey].queueSizeRejectionThreshold   允许在队列中的等待的任务数量 默认值5

  hystrix.threadpool.[threadkey].metrics.rollingStats.timeInMilliseconds 设置统计滚动窗口的长度,以毫秒为单位 默认值10000。

  hystrix.threadpool.[threadkey].metrics.rollingStats.numBuckets 设置统计窗口的桶数量 默认10

HystrixCollapserProperties批处理相关配置:

  hystrix.collapser.[collapserKey].maxRequestsInBatch 单次批处理的最大请求数,达到该数量触发批处理,默认Integer.MAX_VALUE

  hystrix.collapser.[collapserKey].timerDelayInMilliseconds  触发批处理的延迟,也可以为创建批处理的时间+该值,默认值10

  hystrix.collapser.[collapserKey].requestCache.enabled 默认值true

  hystrix.collapser.[collapserKey].metrics.rollingStats.timeInMilliseconds  默认值10000

  hystrix.collapser.[collapserKey].metrics.rollingStats.numBuckets 默认值10

  hystrix.collapser.[collapserKey].metrics.rollingPercentile.enabled 默认值true

  hystrix.collapser.[collapserKey].metrics.rollingPercentile.timeInMilliseconds 默认值60000

  hystrix.collapser.[collapserKey].metrics.rollingPercentile.numBuckets 默认值6

  hystrix.collapser.[collapserKey].metrics.rollingPercentile.bucketSize 默认值100

hystrix熔断器之配置的更多相关文章

  1. feign使用hystrix熔断的配置

    熔断器hystrix 在分布式系统中,每个服务都可能会调用很多其他服务,被调用的那些服务就是依赖服务,有的时候某些依赖服务出现故障也是很正常的. Hystrix 可以让我们在分布式系统中对服务间的调用 ...

  2. hystrix熔断器之metrics

    Metric概述 HystrixCommands和HystrixObservableCommands执行过程中,会产生执行的数据,这些数据对于观察调用的性能表现非常有用. 命令产生数据后,Metric ...

  3. hystrix熔断器之command实现

    HystrixCommand是hystrix执行命令的具体实现,实现流程如下: 1.调用HystrixCommandExecutionHook的onStart方法 3.调用HystrixRequest ...

  4. hystrix熔断器之线程池

    隔离 Hystrix有两种隔离方式:信号量和线程池. 线程池隔离:对每个command创建一个自己的线程池,执行调用.通过线程池隔离来保证不同调用不会相互干扰和每一个调用的并发限制. 信号量隔热:对每 ...

  5. hystrix熔断器之HystrixRequestLog

    HystrixRequestLog会记录所有执行过的命令.

  6. SpringCloud系列七:Hystrix 熔断机制(Hystrix基本配置、服务降级、HystrixDashboard服务监控、Turbine聚合监控)

    1.概念:Hystrix 熔断机制 2.具体内容 所谓的熔断机制和日常生活中见到电路保险丝是非常相似的,当出现了问题之后,保险丝会自动烧断,以保护我们的电器, 那么如果换到了程序之中呢? 当现在服务的 ...

  7. Hystrix 熔断机制

    熔断机制相当于电路的跳闸功能,即在一定时间内,错误比例达到一定数目时业务从原来流程转移到另外的流程处理.在一段时间后,恢复到原业务逻辑. 测试代码如下 /** * @author zimu * @de ...

  8. 服务容错保护断路器Hystrix之五:配置

    接着<服务容错保护断路器Hystrix之二:Hystrix工作流程解析>中的<2.8.关于配置>再列举重要的配置如下 一.hystrix在生产中的建议 1.保持timeout的 ...

  9. springcloud(六) Hystrix 熔断,限流

    Hystrix 熔断: 首先仍然启动Eureka,这里就不说了. OrderController.java: package com.tuling.cloud.study.user.controlle ...

随机推荐

  1. 获取到jqgrid发送的请求得到的数据

    loadComplete: function (data) { console.log(data); }, 例: var jgGrid = $("#jgTable").jqGrid ...

  2. 9.hbase相关进程作用

    1.协调服务组件Zookeeper Zookeeper的作用如下: 1. 保证任何时候,集群中只有一个HMaster: 2. 存储所有的HRegion的寻址入口: 3. 实时监控HRegionServ ...

  3. 通过自定义资源扩展Kubernetes

    原文链接:通过自定义资源扩展Kubernetes

  4. python 报错错误集合——更新中

    1. #!/usr/bin/env python # -*- coding:utf-8 -*- 'one #报错 File "C:\Users\shuxiu\Desktop\test.py& ...

  5. Arduboy基本用法(一)

    Arduboy基本用法(一) 一.第一个Arduboy程序 在arduino中新建项目 示例代码 #include<Arduboy.h> Arduboy arduboy; void set ...

  6. Android 引入第三方类库

  7. FormData格式的数据

    向服务器提交的是FormData格式的数据 || 必须添加以下两个配置项 contentType:false, processData:false,

  8. mysql数据库中数据类型的长度

    在mysql中新建数据表的时候会有长度一说,其实用建表语句建数据表的时候也有涉及 例如: CREATE TABLE user( uid int(4), name varchar(255), passw ...

  9. Promise对象入门

    简介 promise对象可以获取异步操作的消息,提供统一的API,各个异步操作都可以用同样的方法进行处理. promise对象不受外界影响,其有三种状态:pending(进行中).fulfilled( ...

  10. google protocol buffer——protobuf的编码原理二

    这一系列文章主要是对protocol buffer这种编码格式的使用方式.特点.使用技巧进行说明,并在原生protobuf的基础上进行扩展和优化,使得它能更好地为我们服务. 在上一篇文章中,我们主要通 ...