--- kind: CONCEPT slug: grpc-advanced-resilience-c01 title: 헤지는 성공했을지도 모르는 호출에 대해 일어난다 topic: state-machines-and-ownership project: clean-architecture-backend-template status: 게시 전 sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916 rootTreeNode: concept:grpc-advanced-resilience-c01 evidenceCapturedOn: 2026-09-01 assets: - key: grpc-advanced-resilience-c01 file: ../../../final/evidence/rendered/grpc-advanced-resilience-c01.svg - key: grpc-advanced-resilience-c01-diagram file: ../../../final/assets/diagrams/grpc-advanced-resilience-c01.svg evidence: - ../../../final/evidence/raw/grpc-advanced-resilience-c01.txt source: - 원본 분석 절은 analysis/grpc/grpc-advanced-resilience.md#L58 이다. module: grpc-advanced-resilience --- # 헤지는 성공했을지도 모르는 호출에 대해 일어난다 헤징 예산은 토큰 버킷이다. 헤지 하나가 `round(1/ratio)` 토큰을 쓰고, 완료된 호출 하나가 토큰 하나를 돌려준다. ## 본문 토큰 버킷이다. 헤지 하나가 `round(1/ratio)` 토큰을 쓰고, 완료된 호출 하나가 토큰 하나를 돌려준다. 상한이 조용한 구간 뒤의 폭주를 제한한다. ## 헤지가 허용되는 조건 :::evidence key="grpc-advanced-resilience-c01-diagram" alt="첫 시도와 예산 확인과 토큰 소비와 헤지 시도가 왼쪽에서 오른쪽으로 이어지는 구조" caption="헤지가 허용되는 조건" zoom="false" ::: 비율 상한이 0.5 이고 그 근거가 적혀 있다. > "a hedging ratio above 0.5 means more than half of all calls are duplicated, which is a load decision rather than a latency one" ## 재시도 예산보다 급한 이유 > "A retry happens after a failure; a hedge happens on a call that might have succeeded, so a fleet that hedges without a budget doubles its backend load in the steady state and doubles it again the moment latency rises." ## 이 기록이 다루는 파일 범위 :::evidence key="grpc-advanced-resilience-c01" alt="코드베이스에서 파일 목록을 만든 출력 16줄. 이 기록이 다루는 범위가 그 목록이다." caption="코드베이스 파일 목록 — 16줄 · exit 0" zoom="true" ::: ## 소비가 비교 후 교체 루프다 이 가족에서 원자성을 제대로 다룬 몇 안 되는 곳이다.