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

Improve performance of virtual topic fanout

    XMLWordPrintableJSON

Details

    Description

      Virtual topics provide a nice alternative to durable subs. Each durable sub is modeled as a separate queue.
      There are performance implications however, because a message has to be sent to each of the (fanout) queues. For a durable subs, there is a single message in the journal and just index updates for each sub.

      To improve performance there are three ways to improve the comparison between virtual topics and durable subs.

      1. avoid the disk sync associated with enqueue
      2. do parallel enqueues to get the store batching writes
      3. introduce message references in the journal to reduce the disk io

      For 1, introducing a transaction (either client side or automatically, broker side) ensures there is a single disk sync on commit.
      For 2, using an executor to do sends in parallel allows the journal to batch as seen in AMQ-5077
      For 3, the implementation is a lot more involved; for recovery there needs to be a journal write per destination and reading the journal will require two reads because of the indirection. Tracking gc needs to be handled to ensure the referenced entry is maintained. In short this is a lot of work and will only be visible for large (> 8k) messages where the cost of a large v small journal write is noticeable. The messageId dataLocator provides an entry point for this work but considering that 1 & 2 combined can give a 3x improvement I don't think it is worth the effort (and added complexity) at the moment.

      Attachments

        Activity

          People

            gtully Gary Tully
            gtully Gary Tully
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: