Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-1689

(NIO)DataFileAppender does to many sync or force calls when there is little or no concurrency

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 5.1.0
    • 5.1.0
    • Message Store
    • None
    • Windows, NIO force and File sync perform poorly

    • Patch Available

    Description

      Where NIO channel force and fileDescriptor.sync perform poorly and there is little concurrently, the kaha DataFileAppender performs poorly.
      A test case where a single producer and consumer operate from either ends of a networked pair of brokers shows the problem. It takes ~3 minutes to send 1000 messages on windows!. The problem is that 70% of the time is spent in NIO channel.flush()

      The flush is batched if there are concurrent writes, but otherwise, a single write is flushed immediately.
      My proposal is to have the batch processor batch till a batch is full or till a sync flag is present in a write command or till some timeout expires or if the appender is closed.
      This reduces the number of force calls and with this change, my test case can do 1000 messages in ~1minute.

      Attachments

        1. fileAppenderBatch.patch
          27 kB
          Gary Tully

        Activity

          People

            chirino Hiram R. Chirino
            gtully Gary Tully
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: