Skip to content

Log buffer sizing

Tomasz Kowalczewski edited this page Dec 20, 2020 · 11 revisions

Tjahzi uses ManyToOneRingBuffer from Agrona library. It is placed between logging threads and thread that sends log entries to Loki. It is designed to make sure that putting log entry onto the buffer has low overhead. For this reason it avoids using integer division for calculating record offset and uses simple and fast binary math. The downside is that its size must be a power of two (plus some additional bytes at the end used for bookkeeping, see TRAILER_LENGTH in https://github.com/real-logic/agrona/blob/master/agrona/src/main/java/org/agrona/concurrent/ringbuffer/RingBufferDescriptor.java).

Clone this wiki locally