Description
In our previous test(see streaming test doc), we found that SegmentedRaftLogWorker writing RaftLog seriously affected the performance of streaming. Mainly because the flush action was very frequent.
So we can change flush to async. This will greatly improve performance. Of course we'd better make this configurable, which is disable by default.
We previously tried to reduce disk IO by introducing a minimum interval between flushes, the relevant pr is here: https://github.com/apache/ratis/pull/611
However, after subsequent tests, we found that the raft performance has degraded, because flushIfNecessary() function does more operations than just flushing the stream:
Since we enforced the minimum time for each flush, the raft log to can't be committed in flush intervals, which reduces the performance of raft.
So we want to separate out.flush() from flushIfNecessary() and execute it asynchronously, so that the process of writing to disk will not block the operation of other threads.
Attachments
Attachments
Issue Links
- relates to
-
RATIS-1545 Raft log to can't be committed in log flush intervals
- Resolved
- links to