FileChannelJournalSegmentReader throws half buffers away #4248
Labels
area/performance
Marks an issue as performance related
kind/bug
Categorizes an issue or PR as a bug
kind/toil
Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc.
scope/broker
Marks an issue or PR to appear in the broker section of the changelog
Milestone
Description
During our investigation of the engine latency we found out that the atomix journal is a big hotspot performance wise. We had a deeper look at the code and found the
readNext
method.We have to say before that per Zeebe default the
maxEntrySize
is 4 MB. The reader will allocate a buffer which is8MB
big. Our assumption is that it wants to do a read a head, but actually it doesn't because it clears the buffer positions etc.This means we will read
8 MB
process from these~4 MB
until ourremaining
is less thenmaxEntrySize
, so after we reached half of the buffer. Then we will read again8MB
where the other remaining is thrown away and will end at the beginning of the buffer, because it is re-read.This problem is more an issue when the
maxEntrySize
andrealEntrySize
is very different, which is our case. We using4MB
to support big deployments but actually most of our records are less then 1 kb. If the sizes would be nearer then we would probably also read most of the buffer, but this is not our use case so we should fix this!The text was updated successfully, but these errors were encountered: