Uploaded image for project: 'Ratis'
  1. Ratis
  2. RATIS-1534

SegmentedRaftLogWorker should enforce a minimum time interval between flush calls

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Done
    • None
    • 2.3.0
    • server
    • None

    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

        1. image-2022-03-03-16-23-32-929.png
          174 kB
          Junhua Zhang
        2. screenshot-1.png
          195 kB
          mingchao zhao

        Issue Links

          Activity

            People

              sincerexia Junhua Zhang
              micahzhao mingchao zhao
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m