Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-28313

InnoDB transactions are not aligned at cache lines

Details

    Description

      When the lock-free hash table trx_sys.rw_trx_hash was implemented in MariaDB Server 10.3 was implemented, the cache line alignment of transaction objects became more important when iterating the hash table. All trx_t are allocated via trx_pools, and it is easy to change that to return cache line aligned objects.

      Furthermore, rw_trx_hash_element_t::mutex is unnecessarily large. Replacing it with the futex (or Microsoft Windows SRWLOCK) based srw_mutex will shrink the size of a hash table element to 64 bytes (the size of a cache line on most AMD64 implementations). There was an internal interface for PERFORMANCE_SCHEMA instrumentation for the element mutexes, but it was not exposed via all_innodb_mutexes.

      Attachments

        Issue Links

          Activity

            I ran a quick performance comparison, similar to what I conducted in MDEV-21423 yesterday:
            baseline: 10.6 f7f0bc748e88f911b957d3dbf3bc0828a33675fb
            patched: 2aed566d2267a824158025c09830bc6353ec88a9

            version 20 40 80 160 320 640
            baseline 158316.00 184590.99 169979.02 187134.73 178012.51 168005.30
            patched 158265.02 187125.55 172186.49 191218.58 182169.38 169287.10

            During the test with 80 concurrent connections, the throughput dropped due to checkpoint flushing.

            Unlike my attempted fix of MDEV-21423, this small cleanup never seems to hurt performance.

            marko Marko Mäkelä added a comment - I ran a quick performance comparison, similar to what I conducted in MDEV-21423 yesterday: baseline: 10.6 f7f0bc748e88f911b957d3dbf3bc0828a33675fb patched: 2aed566d2267a824158025c09830bc6353ec88a9 version 20 40 80 160 320 640 baseline 158316.00 184590.99 169979.02 187134.73 178012.51 168005.30 patched 158265.02 187125.55 172186.49 191218.58 182169.38 169287.10 During the test with 80 concurrent connections, the throughput dropped due to checkpoint flushing. Unlike my attempted fix of MDEV-21423 , this small cleanup never seems to hurt performance.

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.