`
Seven.Q
  • 浏览: 11260 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Hystrix之CommandProperties说明

 
阅读更多

类别

属性

默认值

说明

circuitBreaker

(控制断路器的行为)

circuitBreaker.enabled

true

 

circuitBreaker.requestVolumeThreshold

20

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

circuitBreaker.sleepWindowInMilliseconds

5000

 

circuitBreaker.errorThresholdPercentage

50

设置失败百分比的阈值。如果失败比率超过这个值,则断路器跳闸并且进入fallback逻辑

circuitBreaker.forceOpen

false

 

circuitBreaker.forceClosed

false

 

Execution

(控制HystrixCommand.run() 的如何执行)

execution.isolation.strategy

THREAD

如果设置属性execution.isolation.strategySEMAPHORE,那么,Hystrix将使用信号量而不是线程来限制调用该命令的发父线程的并数量。

execution.isolation.thread.timeoutInMilliseconds

1000 ms

设置调用者执行的超时时间(单位毫秒)

execution.timeout.enabled

true

 

execution.isolation.thread.interruptOnTimeout

true

表示设置是否在执行超时时,中断HystrixCommand.run() 的执行

execution.isolation.thread.interruptOnFutureCancel

false

表示设置是否在取消任务执行时,中断HystrixCommand.run() 的执行

 

execution.isolation.semaphore.maxConcurrentRequests

10

 

Fallback

(控制HystrixCommand.getFallback() 如何执行。这些属性对隔离策略THREAD SEMAPHORE都起作用)

fallback.isolation.semaphore.maxConcurrentRequests

10

 

fallback.enabled

true

 

metrics

(捕获HystrixCommand HystrixObservableCommand 执行信息相关的配置属性)

metrics.rollingStats.timeInMilliseconds

10000

设置统计滚动窗口的时间长度

metrics.rollingStats.numBuckets

10

设置统计滚动百分比窗口的桶数量

metrics.rollingPercentile.enabled

true

设置执行延迟是否被跟踪,并且被计算在失败百分比中。如果设置为false,则所有的统计数据返回-1

metrics.rollingPercentile.timeInMilliseconds

60000

设置统计滚动百分比窗口的持续时间

metrics.rollingPercentile.numBuckets

6

统计滚动百分比窗口的桶数量

metrics.rollingPercentile.bucketSize

100

此属性设置每个桶保存的执行时间的最大值。如果桶数量是100,统计窗口为10s,如果这10s里有500次执行,只有最后100次执行会被统计到bucket里去

metrics.healthSnapshot.intervalInMilliseconds

500

采样时间间隔

requestCache

requestCache.enabled

true

是否使用缓存

requestCache

requestLog.enabled

true

 

threadpool

allowMaximumSizeToDivergeFromCoreSize

false

 

coreSize

10

 

maximumSize

10

 

keepAliveTimeMinutes

1

 

maxQueueSize

-1

 

queueSizeRejectionThreshold

5

 

metrics.rollingStats.timeInMilliseconds

10000

 

metrics.rollingStats.numBuckets

10

 
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics