InnoDB linear read-ahead (which is enabled when innodb_read_ahead_threshold is nonzero) is being invoked in the low-level function buf_page_get_low(). This does not seem useful for page accesses that are likely to be one-time-only, with no anticipation of accessing nearby pages in the near future.
We should not attempt to invoke read-ahead on index pages that are not at the leaf level.
We should not invoke linear read-ahead in functions that would essentially allocate or free pages, because allocated pages should be reinitialized by buf_page_create(), eliminating the need to read anything from the file system. Likewise, freeing pages should not involve accessing any sibling pages, except for freeing singly-linked lists of BLOB pages.
We should not invoke read-ahead in btr_cur_t::pessimistic_search_leaf() or in a pessimistic operation of btr_cur_t::open_leaf(), because pessimistic operations should be preceded by optimistic operations, which should already have invoked read-ahead.
By doing all this, we will hopefully improve performance in I/O bound workloads.
axel, thank you for the results. I’m happy that there is no regression. I see that in the baseline in tpcc1.pdf there are two dips in the throughput, which are missing for the change under test. This could be luck or a sign of actual improvement, now that some B-tree operations are the only ones that can trigger linear read-ahead.
Marko Mäkelä
added a comment - axel , thank you for the results. I’m happy that there is no regression. I see that in the baseline in tpcc1.pdf there are two dips in the throughput, which are missing for the change under test. This could be luck or a sign of actual improvement, now that some B-tree operations are the only ones that can trigger linear read-ahead.
performed well during RQG testing. No unknown bugs hit.
Matthias Leich
added a comment -
origin/bb-10.6-MDEV-32068 a26c51a190030443063362eb3f21c510fcb3c734 2023-09-05T16:30:53+03:00
performed well during RQG testing. No unknown bugs hit.
This has actually been waiting for me to address the initial review comments that vlad.lesin provided on Septemver 27. Unlike MDEV-30531, which kept me busy for quite some time, this is not likely to yield significant performance gains, but I think that it still is worthwhile as a preparation for MDEV-32067.
Marko Mäkelä
added a comment - This has actually been waiting for me to address the initial review comments that vlad.lesin provided on Septemver 27. Unlike MDEV-30531 , which kept me busy for quite some time, this is not likely to yield significant performance gains, but I think that it still is worthwhile as a preparation for MDEV-32067 .
Marko Mäkelä
added a comment - I tested the impact of removing the read-ahead from trx_undo_get_prev_rec_from_prev_page() and trx_undo_get_first_rec() . This linear read-ahead turned out to improve performance in my extreme benchmark (200MiB of data and 2GiB of undo log pages in a 100MiB buffer pool). So, we will retain the linear read-ahead of undo log pages.
People
Marko Mäkelä
Marko Mäkelä
Votes:
1Vote for this issue
Watchers:
6Start 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":2174.300000190735,"ttfb":1192.9000000953674,"pageVisibility":"visible","entityId":124767,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"8e95bdd8-d6fa-4f80-b0a2-da4289924dc0","navigationType":0,"readyForUser":2258.9000000953674,"redirectCount":0,"resourceLoadedEnd":2735,"resourceLoadedStart":1198.2000002861023,"resourceTiming":[{"duration":469.3999996185303,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":1198.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1198.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1667.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":470.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":1198.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1198.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1669.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":524.3999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":1198.7000002861023,"connectEnd":1198.7000002861023,"connectStart":1198.7000002861023,"domainLookupEnd":1198.7000002861023,"domainLookupStart":1198.7000002861023,"fetchStart":1198.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1198.7000002861023,"responseEnd":1723.0999999046326,"responseStart":1723.0999999046326,"secureConnectionStart":1198.7000002861023},{"duration":581.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":1198.8000001907349,"connectEnd":1198.8000001907349,"connectStart":1198.8000001907349,"domainLookupEnd":1198.8000001907349,"domainLookupStart":1198.8000001907349,"fetchStart":1198.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1198.8000001907349,"responseEnd":1780.5,"responseStart":1780.5,"secureConnectionStart":1198.8000001907349},{"duration":585.3000001907349,"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":1199.0999999046326,"connectEnd":1199.0999999046326,"connectStart":1199.0999999046326,"domainLookupEnd":1199.0999999046326,"domainLookupStart":1199.0999999046326,"fetchStart":1199.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1199.0999999046326,"responseEnd":1784.4000000953674,"responseStart":1784.4000000953674,"secureConnectionStart":1199.0999999046326},{"duration":585.5,"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":1199.3000001907349,"connectEnd":1199.3000001907349,"connectStart":1199.3000001907349,"domainLookupEnd":1199.3000001907349,"domainLookupStart":1199.3000001907349,"fetchStart":1199.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1199.3000001907349,"responseEnd":1784.8000001907349,"responseStart":1784.8000001907349,"secureConnectionStart":1199.3000001907349},{"duration":585.7000002861023,"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":1199.5,"connectEnd":1199.5,"connectStart":1199.5,"domainLookupEnd":1199.5,"domainLookupStart":1199.5,"fetchStart":1199.5,"redirectEnd":0,"redirectStart":0,"requestStart":1199.5,"responseEnd":1785.2000002861023,"responseStart":1785.2000002861023,"secureConnectionStart":1199.5},{"duration":666.4000000953674,"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":1199.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1199.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1866,"responseStart":0,"secureConnectionStart":0},{"duration":586,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":1199.8000001907349,"connectEnd":1199.8000001907349,"connectStart":1199.8000001907349,"domainLookupEnd":1199.8000001907349,"domainLookupStart":1199.8000001907349,"fetchStart":1199.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1199.8000001907349,"responseEnd":1785.8000001907349,"responseStart":1785.8000001907349,"secureConnectionStart":1199.8000001907349},{"duration":666.3000001907349,"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":1199.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1199.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1866.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":586.3000001907349,"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":1200.0999999046326,"connectEnd":1200.0999999046326,"connectStart":1200.0999999046326,"domainLookupEnd":1200.0999999046326,"domainLookupStart":1200.0999999046326,"fetchStart":1200.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1200.0999999046326,"responseEnd":1786.4000000953674,"responseStart":1786.4000000953674,"secureConnectionStart":1200.0999999046326},{"duration":1119.5,"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":1205.4000000953674,"connectEnd":1205.4000000953674,"connectStart":1205.4000000953674,"domainLookupEnd":1205.4000000953674,"domainLookupStart":1205.4000000953674,"fetchStart":1205.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1205.4000000953674,"responseEnd":2324.9000000953674,"responseStart":2324.9000000953674,"secureConnectionStart":1205.4000000953674},{"duration":1529.5,"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":1205.5,"connectEnd":1205.5,"connectStart":1205.5,"domainLookupEnd":1205.5,"domainLookupStart":1205.5,"fetchStart":1205.5,"redirectEnd":0,"redirectStart":0,"requestStart":1205.5,"responseEnd":2735,"responseStart":2735,"secureConnectionStart":1205.5},{"duration":677.5999999046326,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1877.2000002861023,"connectEnd":1877.2000002861023,"connectStart":1877.2000002861023,"domainLookupEnd":1877.2000002861023,"domainLookupStart":1877.2000002861023,"fetchStart":1877.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1877.2000002861023,"responseEnd":2554.800000190735,"responseStart":2554.800000190735,"secureConnectionStart":1877.2000002861023}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":1030,"responseStart":1193,"responseEnd":1199,"domLoading":1196,"domInteractive":2762,"domContentLoadedEventStart":2762,"domContentLoadedEventEnd":2806,"domComplete":3227,"loadEventStart":3227,"loadEventEnd":3228,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2736.800000190735},{"name":"bigPipe.sidebar-id.end","time":2737.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":2737.7000002861023},{"name":"bigPipe.activity-panel-pipe-id.end","time":2739.9000000953674},{"name":"activityTabFullyLoaded","time":2839.0999999046326}],"measures":[],"correlationId":"e046558eaba52d","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":107,"dbReadsTimeInMs":14,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
the overall results show neither improvement nor regression tpcc1.pdf