'circuit breaker'에 해당되는 글 1건

  1. 2021.01.27 Backpressure 가 뭐지?
반응형

마이크로서비스 아키텍처를 공부하다 보면 Circuit Breaker 에 대해서 알게 된다.

여태까지 나는 Circuit Breaker 는 단순히 서비스를 차단해주는 역할을 주라고 생각했는데 그게 아니었음.. ㅠㅠ

 

Circuit Breaker 의 진정한 목적은 Backpressure 를 downstream 에 적용하는 것이라고 할 수 있다. (apply backpressure downstream)

Backpressure 의 의미는 아래 글을 참조..

medium.com/@jayphelps/backpressure-explained-the-flow-of-data-through-software-2350b3e77ce7

 

Backpressure explained — the flow of data through software

Backpressure is something nearly every software engineer will have to deal with at some point, and for some it’s a frequent problem. But…

medium.com

간단히 설명하면 A, B, C 라는 서비스가 각각 D 라는 하나의 서비스를 호출한다고 가정하자. 이 때 D 서비스의 처리량 이상을 A 서비스가 호출한다면, B, C 서비스도 더이상 D 서비스를 호출하여 응답을 받을 수 없다. 그래서 A 서비스가 D를 호출하는 것을 buffer 에 저장하여 잠시 늦추는 효과를 준다면 D 서비스는 이상없이 동작하게 되고 B, C 서비스도 정상적인 응답을 받을 수 있다.

여기서 A서비스에 적용한 것이 Backpressure 이다.

 

Backpressure 를 적용하기 위한 전략은 다음과 같다.

  • Control the producer (slow down/speed up is decided by consumer)
  • Buffer (accumulate incoming data spikes temporarily)
  • Drop (sample a percentage of the incoming data)

오늘 하나 더 배움에 감사하며~~

 

 

 

반응형
Posted by seungkyua@gmail.com
,