TIL

Chapter 14. 고성능 로깅 및 메시징

14.1 로깅

14.1.1 로깅 벤치마크

14.2 성능에 영향이 적은 로거 설계하기

14.3 리얼 로직 라이브러리를 이용해 지연 줄이기

14.3.1 아그로나

아그로나 - 버퍼

아그로나 - 리스트, 맵, 세트

아그로나 - 큐

아그로나 - 링 버퍼

14.3.2 단순 바이너리 인코딩

SBE 설계 결정

SBE 써보기

14.3.3 에어론

에어론 구성 컴포넌트

image

// 발행자
final MediaDriver driver = MediaDriver.lanunch();
final Aeron.Context ctx = new Aeron.Context();
try (Publication publication = aeron.addPublication(CHANNEL, STREAM_ID)) {
    // ...
    final long result = pulication.offer(BUFFER, 0, messageBytes.length);
}

// 구독자
final FragmentHandler fragmentHandler = 
    SamplesUtil.printStringMessage(STREAM_ID);
try (Aeron aeron = Aeron.connect(ctx);
    Subscription subscription = aeron.addSubscription(CHANNEL, STREAM_ID)) {
    SamplesUtil.subscriberLoop(
        fragment, FRAGMENT_COUNT_LIMIT, running
    ).accept(subscription);
}

14.3.4 에어론 설계 개념