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
relates to
MDEV-21423lock-free trx_sys get performance regression cause by lf_find and ut_delay
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 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 Mäkelä
Marko Mäkelä
Votes:
0Vote for this issue
Watchers:
1Start 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.
{"report":{"fcp":927.5,"ttfb":191.80000019073486,"pageVisibility":"visible","entityId":109916,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"826db6c7-3f02-44ec-9e66-5285fc3e2049","navigationType":0,"readyForUser":1012,"redirectCount":0,"resourceLoadedEnd":1071.3000001907349,"resourceLoadedStart":197.30000019073486,"resourceTiming":[{"duration":7.899999618530273,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":197.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":197.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":205.19999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":8,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":197.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":197.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":205.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":155.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":197.80000019073486,"connectEnd":197.80000019073486,"connectStart":197.80000019073486,"domainLookupEnd":197.80000019073486,"domainLookupStart":197.80000019073486,"fetchStart":197.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":197.80000019073486,"responseEnd":353.30000019073486,"responseStart":353.30000019073486,"secureConnectionStart":197.80000019073486},{"duration":225.5999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":198.10000038146973,"connectEnd":198.10000038146973,"connectStart":198.10000038146973,"domainLookupEnd":198.10000038146973,"domainLookupStart":198.10000038146973,"fetchStart":198.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":198.10000038146973,"responseEnd":423.69999980926514,"responseStart":423.69999980926514,"secureConnectionStart":198.10000038146973},{"duration":229.39999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":198.30000019073486,"connectEnd":198.30000019073486,"connectStart":198.30000019073486,"domainLookupEnd":198.30000019073486,"domainLookupStart":198.30000019073486,"fetchStart":198.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":198.30000019073486,"responseEnd":427.69999980926514,"responseStart":427.69999980926514,"secureConnectionStart":198.30000019073486},{"duration":229.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":198.39999961853027,"connectEnd":198.39999961853027,"connectStart":198.39999961853027,"domainLookupEnd":198.39999961853027,"domainLookupStart":198.39999961853027,"fetchStart":198.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":198.39999961853027,"responseEnd":428.19999980926514,"responseStart":428.19999980926514,"secureConnectionStart":198.39999961853027},{"duration":229.89999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":198.60000038146973,"connectEnd":198.60000038146973,"connectStart":198.60000038146973,"domainLookupEnd":198.60000038146973,"domainLookupStart":198.60000038146973,"fetchStart":198.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":198.60000038146973,"responseEnd":428.5,"responseStart":428.5,"secureConnectionStart":198.60000038146973},{"duration":302.4000005722046,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":198.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":198.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":501.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":230,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":199,"connectEnd":199,"connectStart":199,"domainLookupEnd":199,"domainLookupStart":199,"fetchStart":199,"redirectEnd":0,"redirectStart":0,"requestStart":199,"responseEnd":429,"responseStart":429,"secureConnectionStart":199},{"duration":302.1000003814697,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":199.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":199.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":501.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":230.20000076293945,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":199.39999961853027,"connectEnd":199.39999961853027,"connectStart":199.39999961853027,"domainLookupEnd":199.39999961853027,"domainLookupStart":199.39999961853027,"fetchStart":199.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":199.39999961853027,"responseEnd":429.6000003814697,"responseStart":429.6000003814697,"secureConnectionStart":199.39999961853027},{"duration":494,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":205.10000038146973,"connectEnd":205.10000038146973,"connectStart":205.10000038146973,"domainLookupEnd":205.10000038146973,"domainLookupStart":205.10000038146973,"fetchStart":205.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":205.10000038146973,"responseEnd":699.1000003814697,"responseStart":699.1000003814697,"secureConnectionStart":205.10000038146973},{"duration":634.8000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":207,"connectEnd":207,"connectStart":207,"domainLookupEnd":207,"domainLookupStart":207,"fetchStart":207,"redirectEnd":0,"redirectStart":0,"requestStart":207,"responseEnd":841.8000001907349,"responseStart":841.8000001907349,"secureConnectionStart":207},{"duration":176.19999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":523.1999998092651,"connectEnd":523.1999998092651,"connectStart":523.1999998092651,"domainLookupEnd":523.1999998092651,"domainLookupStart":523.1999998092651,"fetchStart":523.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":523.1999998092651,"responseEnd":699.3999996185303,"responseStart":699.3999996185303,"secureConnectionStart":523.1999998092651},{"duration":56.09999942779541,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":796.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":796.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":852.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":264,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":797.1000003814697,"connectEnd":797.1000003814697,"connectStart":797.1000003814697,"domainLookupEnd":797.1000003814697,"domainLookupStart":797.1000003814697,"fetchStart":797.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":797.1000003814697,"responseEnd":1061.1000003814697,"responseStart":1061.1000003814697,"secureConnectionStart":797.1000003814697},{"duration":273.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":797.5,"connectEnd":797.5,"connectStart":797.5,"domainLookupEnd":797.5,"domainLookupStart":797.5,"fetchStart":797.5,"redirectEnd":0,"redirectStart":0,"requestStart":797.5,"responseEnd":1071.3000001907349,"responseStart":1071.3000001907349,"secureConnectionStart":797.5},{"duration":210.39999961853027,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":945.6000003814697,"connectEnd":945.6000003814697,"connectStart":945.6000003814697,"domainLookupEnd":945.6000003814697,"domainLookupStart":945.6000003814697,"fetchStart":945.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":945.6000003814697,"responseEnd":1156,"responseStart":1156,"secureConnectionStart":945.6000003814697}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":35,"responseStart":192,"responseEnd":207,"domLoading":196,"domInteractive":1088,"domContentLoadedEventStart":1088,"domContentLoadedEventEnd":1145,"domComplete":1383,"loadEventStart":1383,"loadEventEnd":1384,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1050.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1051.3999996185303},{"name":"bigPipe.activity-panel-pipe-id.start","time":1051.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":1052.8999996185303},{"name":"activityTabFullyLoaded","time":1161.3999996185303}],"measures":[],"correlationId":"4d328c331d5385","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":96,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I ran a quick performance comparison, similar to what I conducted in MDEV-21423 yesterday:
baseline: 10.6 f7f0bc748e88f911b957d3dbf3bc0828a33675fb
patched: 2aed566d2267a824158025c09830bc6353ec88a9
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.