Hystrixマニュアル

13207 ワード

レポートhystrixタイムアウト異常は次のとおりです.
hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 10000
  threadpool:
    default:
      coreSize: 20 # 
      maximumSize: 200 # 
      allowMaximumSizeToDivergeFromCoreSize: true # 
      maxQueueSize: 1000 # 
      queueSizeRejectionThreshold: 1000 # 

この構成はグローバルなタイムアウト構成をしただけで、実際にはこのブロックは最適化できます.もちろん、このブロックには他の問題があるかもしれません.hystrix.command.default.circuitBreaker.Enabledのデフォルトがtrueの10 sなど20個のリクエストに失敗したり、エラーレートバルブ値>50が溶融したりします.溶融後のデフォルト5 sはリクエストを拒否します(ここではすべてのリクエストを拒否する問題がありますか?どのように回復しますか).溶断を必要としないならcommand.default.circuitBreaker.enabled=false溶断が必要な場合はhystrix.command.default.circuitBreaker.requestVolumeThreshold hystrix.command.default.circuitBreaker.sleepWindowInMilliseconds hystrix.command.default.circuitBreaker.errorThresholdPercentageを設定します.ここで質問があります(リクエストの失敗の具体的な意味は何ですか)
溶断後にhalf-open状態があり、hystrixはsingle requestテストが成功したかどうかをサポートしています.このrequestが失敗したら溶断を続けます.成功すると回復する
なぜ指定モジュールをタイムアウト設定できないのか、どのように設定するのか.実はいいです.あるいはgit開発ドキュメントを見ると、異なるcommandが異なるポリシーを使用することができ、異なるcommandの間で異なるスレッドプールを使用することができることをより理解しやすいはずです.
hystrix.command.default     hystrix.command.commandkey 
commandkey  command 

hystrix.threadpool.default    hystrix.command.threadpoolkey
 
    @HystrixCommand(groupKey = "fallback",
            commandKey = "fallback", threadpoolkey=“fallback”
    fallbackMethod = "hystrixFallBack")


皆さんはこの点を見て理解したはずです.デフォルトthreadpoolkeyはgroupKeyとして書きません.
下図は圧力測定テストログ
3s timeout limit 
sleep
null
fallback
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep end
3s timeout limit 
sleep
null
fallback
null
null
fallback
null
fallback
null
fallback
fallback
null
null
fallback
null
fallback
null
fallback
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
3s timeout limit 
3s timeout limit 
3s timeout limit 
sleep end
sleep end
sleep end
3s timeout limit 
sleep end
3s timeout limit 
3s timeout limit 
sleep end
3s timeout limit 
sleep end
sleep end
sleep end
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
3s timeout limit 
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep
sleep end
3s timeout limit 
sleep
null
null
null
fallback
null
fallback
null
fallback
fallback
fallback
null
fallback
null
fallback
null
fallback
null
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
null
fallback
fallback
Hystrix circuit short-circuited and is OPEN
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
Hystrix circuit short-circuited and is OPEN
fallback
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
Hystrix circuit short-circuited and is OPEN
fallback
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end
sleep end


10 s以前のリクエストはすべて3 s timeout limit->sleep->null->failback->sleep end実はインタフェースがfailbackプロセスをタイムアウトし、10 s後にfallback->Hystrix circuit short-circuited and is OPENが現れて溶断が始まり、この時すべてのリクエストは実際には業務方法を踏まずfailbackメソッドに直接到着します.上の図ではリカバリプロセスが見えません
HystrixBadRequestException以外の例外については、HystrixBadRequestExceptionがヒューズカウントとして集計されます.@HystrixCommand注記を使用する方法では、遠隔呼び出しではなく、異常が爆発しても溶断メカニズムがトリガーされるのではないかという疑問があります.答えは、次の図のように、空の異常を投げ出すと、溶断fallbackを招くことになります.
 @HystrixCommand(groupKey = "test",
            commandKey = "test",
            fallbackMethod = "hystrixFallBack")
    @GetMapping(value = "/testException")
    public List general1() {
        Integer i = null ;
        try {
            Thread.sleep(4000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        int b =  i.intValue();
        return new ArrayList<>();
    }

そして@HystrixCommand注記がないとfallbackメソッドはトリガーされませんが、溶断するかどうかテストはできないようです.最も良い1つの問題の溶断の範囲、異なるcommandkey、異なるthreadpool keyの下で互いに影響しないで、異なるcommandkey、同じthreadpool keyの下で影響を受けますか?タイムアウトポリシーと溶断ポリシーは異なり、影響はありません.スレッドプールポリシーに影響がある可能性があります.コードをテストしたいならメッセージを残してください.
hystrixが合併を要請したのは、会社が使えないはずだ.hystrixリクエストキャッシュはスリルがあります