Hystrix 配置属性参考

介绍

Hystrix使用Archaius作为配置属性的默认实现。

下面的文档描述了默认使用的HystrixPropertiesStrategy实现,你也可以使用插件的方式来覆盖它。

每个属性有四个优先级:

  1. 代码的全局默认值

    如果没有设置以下3个,则这是默认值。 全局默认值在下表中显示为 “默认值”

  2. 动态全局默认属性

    你可以使用属性更改全局默认值。 全局默认属性名称在下表中显示为 “默认属性”

  3. 用代码定义默认实例属性

    你可以定义特定于实例的默认值。例:

     HystrixCommandProperties.Setter().withExecutionTimeoutInMilliseconds(int value)
    

    你需要类似于以下的方式将这种命令插入到HystrixCommand构造函数中:

     public HystrixCommandInstance(int id) {
         super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("ExampleGroup"))
                     .andCommandPropertiesDefaults(HystrixCommandProperties.Setter().withExecutionTimeoutInMilliseconds(500)));
         this.id = id;
     }
    

    一般的设置初始值可以采用便利的构造函数方式。这是一个例子:

     public HystrixCommandInstance(int id) {
         super(HystrixCommandGroupKey.Factory.asKey("ExampleGroup"), 500);
         this.id = id;
     }
    
  4. 动态设置实例属性

    你可以动态设置实例特定的值,从而覆盖前面三个默认级别。

    动态实例属性名称在下表中显示为 “实例属性”

    例:

    实例属性hystrix.command.HystrixCommandKey.execution.isolation.thread.timeoutInMilliseconds

    将属性的HystrixCommandKey部分替换为您所定位的HystrixCommandHystrixCommandKey.name())值。

    例如,如果被命名为“SubscriberGetAccount”,则属性名称将是:

    hystrix.command.SubscriberGetAccount.execution.isolation.thread.timeoutInMilliseconds

命令属性(Command Properties)

以下属性将控制HystrixCommand的行为:

执行(Execution)

以下属性控制HystrixCommand.run())执行。

execution.isolation.strategy

这个属性指示HystrixCommand.run()执行的隔离策略,有以下两种选择之一:

  • THREAD —— 它在单独的线程上执行,并发请求受线程池中线程数量的限制
  • SEMAPHORE —— 它在调用线程上执行,并发请求受信号计数的限制

线程或信号量

缺省值和建议的设置是运行HystrixCommand时使用线程隔离(THREAD),和运行HystrixObservableCommand时使用信号隔离(SEMAPHORE)。

在线程中执行命令能对网络超时提供另一层保护。

通常情况下,对于HystrixCommand来说,唯一使用信号量隔离的场景是,当调用量非常大(每秒数百次)时单独线程的开销太高;这通常只适用于非网络调用。

Netflix的API在40+线程池中运行100+命令,并且只有少数命令不在线程中运行 —— 那些从内存中的缓存提取元数据或或是门面到线程隔离命令(更多信息请参见Primary + Secondary with Fallback” pattern)。

isolation-options

更多信息请参见隔离是如何工作的

默认值THREAD(参见:ExecutionIsolationStrategy.THREAD
取值范围THREAD, SEMAPHORE
默认属性hystrix.command.default.execution.isolation.strategy
实例属性hystrix.command.HystrixCommandKey.execution.isolation.strategy
如何设置
默认实例
// to use thread isolation
HystrixCommandProperties.Setter().withExecutionIsolationStrategy(ExecutionIsolationStrategy.THREAD)
// to use semaphore isolation
HystrixCommandProperties.Setter().withExecutionIsolationStrategy(ExecutionIsolationStrategy.SEMAPHORE)

execution.isolation.thread.timeoutInMilliseconds

该属性设置以毫秒为单位,在该时间之后,调用者将观察到超时并离开命令执行。 Hystrix将HystrixCommand标记为TIMEOUT,并执行回退逻辑。请注意,如果需要可以为每个命令配置关闭超时的设置(请参阅command.timeout.enabled)。

注意: 超时将在HystrixCommand.queue()上触发,即使调用者从未在生成的Future上调用get()。在Hystrix 1.4.0之前,只有调用get()才能使超时机制在这种情况下生效。

默认值1000
默认属性hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds
实例属性hystrix.command.HystrixCommandKey.execution.isolation.thread.timeoutInMilliseconds
如何设置
默认实例
HystrixCommandProperties.Setter().withExecutionTimeoutInMilliseconds(int value)

execution.timeout.enabled

该属性指示HystrixCommand.run()执行是否应该有一个超时。

默认值true
默认属性hystrix.command.default.execution.timeout.enabled
实例属性hystrix.command.HystrixCommandKey.execution.timeout.enabled
如何设置
默认实例
HystrixCommandProperties.Setter().withExecutionTimeoutEnabled(boolean value)

execution.isolation.thread.interruptOnTimeout

这个属性指示HystrixCommand.run()执行是否应该在发生超时时被中断。

默认值true
默认属性hystrix.command.default.execution.isolation.thread.interruptOnTimeout
实例属性hystrix.command.HystrixCommandKey.execution.isolation.thread.interruptOnTimeout
如何设置
默认实例
HystrixCommandProperties.Setter().withExecutionIsolationThreadInterruptOnTimeout(boolean value)

execution.isolation.thread.interruptOnCancel

这个属性指示HystrixCommand.run()执行是否应该在发生取消时被中断。

默认值false
默认属性hystrix.command.default.execution.isolation.thread.interruptOnCancel
实例属性hystrix.command.HystrixCommandKey.execution.isolation.thread.interruptOnCancel
如何设置
默认实例
HystrixCommandProperties.Setter().withExecutionIsolationThreadInterruptOnCancel(boolean value)

execution.isolation.semaphore.maxConcurrentRequests

当您使用ExecutionIsolationStrategy.SEMAPHORE时,此属性设置允许HystrixCommand.run()方法的最大请求数。

如果达到这个最大并发限制,则后续请求将被拒绝。

当你选择一个信号量时,你使用的逻辑基本上和你选择线程池中添加多少个线程相同,但是信号量的开销要小得多,通常执行速度要快得多(亚毫秒) ,否则你会使用线程。

例如,5000rps的单个实例在内存中查找指标聚集仅需要2个信号量就能工作。

隔离原理仍然是相同的,所以信号量应该仍然是整个容器(如:Tomcat)线程池的一小部分,而不是全部或大部分,否则它不提供保护。

默认值10
默认属性hystrix.command.default.execution.isolation.semaphore.maxConcurrentRequests
实例属性hystrix.command.HystrixCommandKey.execution.isolation.semaphore.maxConcurrentRequests
如何设置
默认实例
HystrixCommandProperties.Setter().withExecutionIsolationSemaphoreMaxConcurrentRequests(int value)

回退(Fallback)

以下属性控制HystrixCommand.getFallback()如何执行。这些属性适用于ExecutionIsolationStrategy.THREADExecutionIsolationStrategy.SEMAPHORE

fallback.isolation.semaphore.maxConcurrentRequests

该属性设置HystrixCommand.getFallback()方法允许从调用线程中创建的最大请求数。

如果达到最大并发限制,则随后的请求将被拒绝并抛出异常,因为没有回退被提取到。

默认值10
默认属性hystrix.command.default.fallback.isolation.semaphore.maxConcurrentRequests
实例属性hystrix.command.HystrixCommandKey.fallback.isolation.semaphore.maxConcurrentRequests
如何设置
默认实例
HystrixCommandProperties.Setter().withFallbackIsolationSemaphoreMaxConcurrentRequests(int value)

fallback.enabled

Since: 1.2

该属性设置是否在发生故障或拒绝时尝试调用HystrixCommand.getFallback()

默认值true
默认属性hystrix.command.default.fallback.enabled
实例属性hystrix.command.HystrixCommandKey.fallback.enabled
如何设置
默认实例
HystrixCommandProperties.Setter().withFallbackEnabled(boolean value)

断路器(Circuit Breaker)

断路器属性控制HystrixCircuitBreaker的行为。

circuitBreaker.enabled

该属性设置是否将使用断路器来跟踪健康状况并且如果断路器跳闸则将其短路。

默认值true
默认属性hystrix.command.default.circuitBreaker.enabled
实例属性hystrix.command.HystrixCommandKey.circuitBreaker.enabled
如何设置
默认实例
HystrixCommandProperties.Setter().withCircuitBreakerEnabled(boolean value)

circuitBreaker.requestVolumeThreshold

该属性设置滚动窗口中将使电路跳闸的最小请求数量。

例如,如果值是20,那么如果在滚动窗口中接收到19个请求(例如10秒的窗口),则即使所有19个请求都失败,电路也不会跳闸。

默认值20
默认属性hystrix.command.default.circuitBreaker.requestVolumeThreshold
实例属性hystrix.command.HystrixCommandKey.circuitBreaker.requestVolumeThreshold
如何设置
默认实例
HystrixCommandProperties.Setter().withCircuitBreakerRequestVolumeThreshold(int value)

circuitBreaker.sleepWindowInMilliseconds

该属性设置跳闸后的时间量,拒绝请求,然后再次尝试确定电路是否应再次闭合。

默认值5000
默认属性hystrix.command.default.circuitBreaker.sleepWindowInMilliseconds
实例属性hystrix.command.HystrixCommandKey.circuitBreaker.sleepWindowInMilliseconds
如何设置
默认实例
HystrixCommandProperties.Setter().withCircuitBreakerSleepWindowInMilliseconds(int value)

circuitBreaker.errorThresholdPercentage

该属性设置错误百分比,在该值以上,电路应断开并开始将请求短路到回退逻辑。

默认值50
默认属性hystrix.command.default.circuitBreaker.errorThresholdPercentage
实例属性hystrix.command.HystrixCommandKey.circuitBreaker.errorThresholdPercentage
如何设置
默认实例
HystrixCommandProperties.Setter().withCircuitBreakerErrorThresholdPercentage(int value)

circuitBreaker.forceOpen

如果该属性为真,则强制断路器进入打开(跳闸)状态,将拒绝所有的请求。

此属性优先于circuitBreaker.forceClosed

默认值false
默认属性hystrix.command.default.circuitBreaker.forceOpen
实例属性hystrix.command.HystrixCommandKey.circuitBreaker.forceOpen
如何设置
默认实例
HystrixCommandProperties.Setter().withCircuitBreakerForceOpen(boolean value)

circuitBreaker.forceClosed

如果该属性为真,则强制断路器进入关闭状态,在该状态下将允许请求,而不管错误百分比如何。

circuitBreaker.forceOpen属性优先,所以如果它被设置为true,这个属性什么都不做。

默认值false
默认属性hystrix.command.default.circuitBreaker.forceClosed
实例属性hystrix.command.HystrixCommandKey.circuitBreaker.forceClosed
如何设置
默认实例
HystrixCommandProperties.Setter().withCircuitBreakerForceClosed(boolean value)

度量(Mitrics)

以下属性与从HystrixCommandHystrixObservableCommand执行捕获指标有关。

metrics.rollingStats.timeInMilliseconds

该属性设置统计滚动窗口的持续时间,以毫秒为单位。这是Hystrix保持断路器使用和发布指标的时间。

从1.4.12开始,此属性仅影响初始度量标准的创建,启动后对此属性所做的调整将不会生效。这样可以避免指标数据丢失,也可以优化指标收集。

窗口根据这些增量被分成桶和“卷”。

例如,如果将此属性设置为10秒(10000),具有十个1秒桶的,则下图显示了如何将新桶和旧桶关闭:

rolling-stats

默认值10000
默认属性hystrix.command.default.metrics.rollingStats.timeInMilliseconds
实例属性hystrix.command.HystrixCommandKey.metrics.rollingStats.timeInMilliseconds
如何设置
默认实例
HystrixCommandProperties.Setter().withMetricsRollingStatisticalWindowInMilliseconds(int value)

metrics.rollingStats.numBuckets

该属性设置滚动统计窗口分成的桶的数量。

注意: 必须要确保如下条件: “metrics.rollingStats.timeInMilliseconds % metrics.rollingStats.numBuckets == 0” , 否则会引发异常。

换句话说,10000/10是可以的,10000/20也行,但是10000/7不行。

从1.4.12开始,此属性仅影响初始度量标准的创建,启动后对此属性所做的调整将不会生效。这样可以避免指标数据丢失,也可以优化指标收集。

默认值10
取值范围可以被metric.rollingStats.timeInMilliseconds整除的任何值。结果应该是数百或数千毫秒的桶。大容量的性能还没有测试过小于100ms的桶。
默认属性hystrix.command.default.metrics.rollingStats.numBuckets
实例属性hystrix.command.HystrixCommandKey.metrics.rollingStats.numBuckets
如何设置
默认实例
HystrixCommandProperties.Setter().withMetricsRollingStatisticalWindowBuckets(int value)

metrics.rollingPercentile.enabled

这个属性表示执行延迟是否应该跟踪和计算为百分比。如果他们被禁用,则所有汇总统计(平均值,百分位数)返回为-1。

默认值true
默认属性hystrix.command.default.metrics.rollingPercentile.enabled
实例属性hystrix.command.HystrixCommandKey.metrics.rollingPercentile.enabled
如何设置
默认实例
HystrixCommandProperties.Setter().withMetricsRollingPercentileEnabled(boolean value)

metrics.rollingPercentile.timeInMilliseconds

此属性设置滚动窗口的持续时间,在该窗口中保留执行时间以允许百分数计算(以毫秒为单位)。

窗口根据这些增量被分成桶和“卷”。

从1.4.12开始,此属性仅影响初始度量标准的创建,启动后对此属性所做的调整将不会生效。这样可以避免指标数据丢失,也可以优化指标收集。

默认值6000
默认属性hystrix.command.default.metrics.rollingPercentile.timeInMilliseconds
实例属性hystrix.command.HystrixCommandKey.metrics.rollingPercentile.timeInMilliseconds
如何设置
默认实例
HystrixCommandProperties.Setter().withMetricsRollingPercentileWindowInMilliseconds(int value)

metrics.rollingPercentile.numBuckets

这个属性设置了rollingPercentile窗口将被分成的桶的数量。

注意: 必须要确保如下条件:“metrics.rollingPercentile.timeInMilliseconds % metrics.rollingPercentile.numBuckets == 0” ,否则会引发异常。

换句话说,60000/6是可以的,60000/60也是可以的,但10000/7不行。

从1.4.12开始,此属性仅影响初始度量标准的创建,启动后对此属性所做的调整将不会生效。这样可以避免指标数据丢失,也可以优化指标收集。

默认值6
取值范围可以被metric.rollingPercentile.timeInMilliseconds整除的任何值。结果应该是数千毫秒的桶。大容量的性能还没有测试过小于1000ms的桶。
默认属性hystrix.command.default.metrics.rollingPercentile.numBuckets
实例属性hystrix.command.HystrixCommandKey.metrics.rollingPercentile.numBuckets
如何设置
默认实例
HystrixCommandProperties.Setter().withMetricsRollingPercentileWindowBuckets(int value)

metrics.rollingPercentile.bucketSize

该属性设置每个桶的最大执行次数。如果更多的执行在此期间发生,他们将环绕并开始在桶的开头重写。

例如,如果桶大小设置为100,并桶的窗口为10秒,但是在此期间发生500次执行,则只有最后100次执行将保留在该10秒的桶中。

如果增加这个大小,这也增加了存储值所需的内存量,并增加了对列表进行排序以进行百分比计算所需的时间。

从1.4.12开始,此属性仅影响初始度量标准的创建,启动后对此属性所做的调整将不会生效。这样可以避免指标数据丢失,也可以优化指标收集。

默认值100
默认属性hystrix.command.default.metrics.rollingPercentile.bucketSize
实例属性hystrix.command.HystrixCommandKey.metrics.rollingPercentile.bucketSize
如何设置
默认实例
HystrixCommandProperties.Setter().withMetricsRollingPercentileBucketSize(int value)

metrics.healthSnapshot.intervalInMilliseconds

此属性设置允许执行运行成功和错误百分比并影响断路器状态的健康快照之间等待的时间(以毫秒为单位)。

在大容量的电路上,连续计算误差百分比可能会成为CPU密集型的,因此这个属性允许你控制计算的频率。

默认值500
默认属性hystrix.command.default.metrics.healthSnapshot.intervalInMilliseconds
实例属性hystrix.command.HystrixCommandKey.metrics.healthSnapshot.intervalInMilliseconds
如何设置
默认实例
HystrixCommandProperties.Setter().withMetricsHealthSnapshotIntervalInMilliseconds(int value)

请求上下文(Request Context)

这些属性涉及HystrixCommand使用HystrixRequestContext功能。

requestCache.enabled

此属性指示HystrixCommand.getCacheKey())是否应与HystrixRequestCache一起使用,以通过请求范围缓存提供重复数据删除功能。

默认值true
默认属性hystrix.command.default.requestCache.enabled
实例属性hystrix.command.HystrixCommandKey.requestCache.enabled
如何设置
默认实例
HystrixCommandProperties.Setter().withRequestCacheEnabled(boolean value)

requestLog.enabled

此属性指示是否应将HystrixCommand执行和事件记录到HystrixRequestLog

默认值true
默认属性hystrix.command.default.requestLog.enabled
实例属性hystrix.command.HystrixCommandKey.requestLog.enabled
如何设置
默认实例
HystrixCommandProperties.Setter().withRequestLogEnabled(boolean value)

破裂器属性(Collapser Properties)

以下属性控制HystrixCollapser行为。

maxRequestsInBatch

此属性设置批处理允许的最大请求数量,然后触发批处理执行。

默认值Integer.MAX_VALUE
默认属性hystrix.collapser.default.maxRequestsInBatch
实例属性hystrix.collapser.HystrixCollapserKey.maxRequestsInBatch
如何设置
默认实例
HystrixCollapserProperties.Setter().withMaxRequestsInBatch(int value)

timerDelayInMilliseconds

此属性设置触发执行之后创建批处理的毫秒数。

默认值10
默认属性hystrix.collapser.default.timerDelayInMilliseconds
实例属性hystrix.collapser.HystrixCollapserKey.timerDelayInMilliseconds
如何设置
默认实例
HystrixCollapserProperties.Setter().withTimerDelayInMilliseconds(int value)

requestCache.enabled

此属性指示是否为HystrixCollapser.execute()HystrixCollapser.queue()调用启用了请求缓存。

默认值true
默认属性hystrix.collapser.default.requestCache.enabled
实例属性hystrix.collapser.HystrixCommandKey.requestCache.enabled
如何设置
默认实例
HystrixCollapserProperties.Setter().withRequestCacheEnabled(boolean value)

线程池属性(Thread Pool Properties)

以下属性控制Hystrix命令执行的线程池的行为。请注意,这些名称与ThreadPoolExecutor Javadoc中的名称相匹配

大多数情况下,10个线程的默认值都可以(通常可以做得更小)。

要确定是否需要更大,计算大小的基本公式是:

在健康时每秒的请求高峰数 × 99%的延迟秒数+一些喘息的空间时。

看下面的例子,看看这个公式是如何实施的。 总体原则是尽可能保持池的小,因为它是减轻负载并防止资源在延迟发生时被阻塞的主要工具。

Netflix API有30+的线程池被设置为10,两个在20,一个在25。

thread-configuration

上图显示了一个配置示例,其中依赖关系没有理由达到第99.5百分位,因此它在网络超时层将其缩短,并立即重试,并期望大部分时间会得到中位延迟能够在300ms线程超时内完成这一切。

如果依赖有合法的理由有时达到99.5%(比如缓存未命中),那么网络超时将被设置得比它高,比如325ms,重试0或1次,线程超时设置更高(350ms + )。

线程池的大小为10,以处理第99个百分点请求的突发,但是当一切正常时,此线程池通常在任何给定时间通常只有1或2个线程处于活动状态,以服务大多数40ms的中间调用。

当你正确地配置它时,HystrixCommand层的超时应该是很少的,但是如果网络等待时间以外的事情影响了时间,或者在最坏的情况下连接+读+重试+连接+读超过配置的整体超时。

每个方向的配置和折衷的攻击性对于每个依赖性是不同的。

当性能特征发生变化或发现问题时,您可以根据需要实时更改配置,而且如果出现问题或配置错误,则无需关闭整个应用程序。

coreSize

此属性设置核心线程数。

默认值10
默认属性hystrix.threadpool.default.coreSize
实例属性hystrix.threadpool.HystrixThreadPoolKey.coreSize
如何设置
默认实例
HystrixThreadPoolProperties.Setter().withCoreSize(int value)

maximumSize

1.5.9中添加。该属性设置最大的线程池大小。这是开始无需拒绝HystrixCommand即可支持的最大并发数量。请注意,如果您还设置了allowMaximumSizeToDivergeFromCoreSize,则此设置才会生效。在1.5.9之前,核心和最大大小总是相等的。

默认值10
默认属性hystrix.threadpool.default.maximumSize
实例属性hystrix.threadpool.HystrixThreadPoolKey.maximumSize
如何设置
默认实例
HystrixThreadPoolProperties.Setter().withMaximumSize(int value)

maxQueueSize

该属性设置BlockingQueue实现的最大队列大小。

如果将其设置为-1,则将使用SynchronousQueue,其它正值将使用LinkedBlockingQueue

注意: 这个属性只适用于初始化时间,因为如果不重新初始化线程执行器,不支持的队列被调整或改变。

如果您需要越过此限制并允许在队列中进行动态更改,请参阅queueSizeRejectionThreshold属性。

要在SynchronousQueueLinkedBlockingQueue之间切换,需要重新启动。

默认值-1
默认属性hystrix.threadpool.default.maxQueueSize
实例属性hystrix.threadpool.HystrixThreadPoolKey.maxQueueSize
如何设置
默认实例
HystrixThreadPoolProperties.Setter().withMaxQueueSize(int value)

queueSizeRejectionThreshold

此属性设置队列大小拒绝阈值 —— 即使maxQueueSize尚未达到,拒绝将发生的人为最大队列大小。此属性的存在是因为BlockingQueuemaxQueueSize不能动态更改,我们希望允许您动态更改影响拒绝的队列大小。

当排队一个线程执行时,HystrixCommand使用它。

注意: 如果maxQueueSize == -1,则此属性不适用。

默认值5
默认属性hystrix.threadpool.default.queueSizeRejectionThreshold
实例属性hystrix.threadpool.HystrixThreadPoolKey.queueSizeRejectionThreshold
如何设置
默认实例
HystrixThreadPoolProperties.Setter().withQueueSizeRejectionThreshold(int value)

keepAliveTimeMinutes

该属性设置保持活动时间,以分钟为单位。 在1.5.9之前,所有线程池都是固定大小的,如coreSize == maximumSize。在1.5.9之后,将allowMaximumSizeToDivergeFromCoreSize设置为true允许这两个值发散,以便线程池可以获取/释放线程。如果coreSize <maximumSize,那么这个属性控制一个线程在被释放之前将不被使用的时间。

默认值1
默认属性hystrix.threadpool.default.keepAliveTimeMinutes
实例属性hystrix.threadpool.HystrixThreadPoolKey.keepAliveTimeMinutes
如何设置
默认实例
HystrixThreadPoolProperties.Setter().withKeepAliveTimeMinutes(int value)

allowMaximumSizeToDivergeFromCoreSize

1.5.9中添加。此属性允许maximumSize的配置生效。该值可以等于或高于coreSize。设置coreSize <maximumSize会创建一个线程池,它可以支持maximumSize并发性,但是会在相对不活动的时间内将线程返回给系统。 (以keepAliveTimeInMinutes为准)

默认值false
默认属性hystrix.threadpool.default.allowMaximumSizeToDivergeFromCoreSize
实例属性hystrix.threadpool.HystrixThreadPoolKey.allowMaximumSizeToDivergeFromCoreSize
如何设置
默认实例
HystrixThreadPoolProperties.Setter().withAllowMaximumSizeToDivergeFromCoreSize(boolean value)

metrics.rollingStats.timeInMilliseconds

该属性设置统计滚动窗口的持续时间,以毫秒为单位。这是为线程池保留多长时间的指标。

窗口根据这些增量被分成桶和“卷”。

默认值10000
默认属性hystrix.threadpool.default..metrics.rollingStats.timeInMilliseconds
实例属性hystrix.threadpool.HystrixThreadPoolKey.metrics.rollingStats.timeInMilliseconds
如何设置
默认实例
HystrixThreadPoolProperties.Setter().withMetricsRollingStatisticalWindowInMilliseconds(int value)

metrics.rollingStats.numBuckets

该属性设置滚动统计窗口分成的桶的数量。

注意: 必须要确保如下条件:“metrics.rollingStats.timeInMilliseconds % metrics.rollingStats.numBuckets == 0” ,否则会引发异常。

换句话说,10000/10是可以的,10000/20也可以,但是10000/7不行。

默认值10
取值范围能被metrics.rollingStats.timeInMilliseconds整除的任何值,结果应该是数百或数千毫秒的桶。大容量的性能还没有测试过小于100ms的桶。
默认属性hystrix.threadpool.default.metrics.rollingStats.numBuckets
实例属性hystrix.threadpool.HystrixThreadPoolKey.metrics.rollingStats.numBuckets
如何设置
默认实例
HystrixThreadPoolProperties.Setter().withMetricsRollingStatisticalWindowBuckets(int value)

参考资料

https://github.com/Netflix/Hystrix/wiki/Configuration


   转载规则


《Hystrix 配置属性参考》 Angus_Lu 采用 知识共享署名 4.0 国际许可协议 进行许可。
  目录