Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-4773

Performance improvement on page.sync

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.34.0
    • None
    • None

    Description

      PagingStoreImpl::ioSync is holding a readWriteLock while calling sync:

      https://github.com/apache/activemq-artemis/blob/c523458a9aa4f67ad0e9bdbc5c4733bc88bf55f6/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java#L516-L529

      However that's causing a contention on adding new data:

      at jdk.internal.misc.Unsafe.park(java.base@17.0.11/Native Method)

      • parking to wait for <0x000000008087a170> (a java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync)
        at java.util.concurrent.locks.LockSupport.park(java.base@17.0.11/LockSupport.java:211)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.11/AbstractQueuedSynchronizer.java:715)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(java.base@17.0.11/AbstractQueuedSynchronizer.java:938)
        at java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock(java.base@17.0.11/ReentrantReadWriteLock.java:959)
        at org.apache.activemq.artemis.core.paging.impl.PagingStoreImpl.writePage(PagingStoreImpl.java:1249)
        at org.apache.activemq.artemis.core.paging.impl.PagingStoreImpl.page(PagingStoreImpl.java:1242)
        at org.apache.activemq.artemis.core.paging.impl.PagingStoreImpl.page(PagingStoreImpl.java:1173)
        at org.apache.activemq.artemis.core.persistence.impl.journal.AbstractJournalStorageManager.addToPage(AbstractJournalStorageManager.java:2256

      To fix that I'm going to remove the sync from the readWriteLock. and Ignore an alreadyClosedException.

      I tested this, and also an user and the improvement was significant, especially with a slower device (that's actually more common on cloud providers these days).

      Attachments

        Activity

          People

            Unassigned Unassigned
            clebertsuconic Clebert Suconic
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: