In MDEV-23855, I overlooked the fact that the default value 0 of the parameter innodb_max_dirty_pages_pct_lwm has a special meaning: "ignore this parameter, and look at innodb_max_dirty_pages_pct instead". This special value used to partially cancel the effect of the parameter innodb_adaptive_flushing=ON (which is set by default). The special value 0 would cause the function af_get_pct_for_dirty() to always return either 0 or 100.
This regression was originally reported in MDEV-24272, mixed up with another performance regression that only affects the 10.2, 10.3, and 10.4 release series but not 10.5. On a hard disk, running a 5-minute oltp_read_write in sysbench with 16 threads and 8 tables with 100000 rows each, I verified valerii's finding, using the following settings on MariaDB 10.5.6 and 10.5.8:
innodb_log_file_size=4G
|
innodb_buffer_pool_size=1G
|
innodb_flush_log_at_trx_commit=2
|
innodb-flush-method=O_DIRECT
|
On my 2TB Western Digital SATA 3.0 hard disk (WDC WD20EZRZ-00Z5HB0) that has a write performance of 51.9 MB/s (reported by GNOME Disks when using 1MiB block size), I got the following results:
server |
average throughput/tps |
average latency/ms |
maximum latency/ms |
10.5.6 |
4672.70 |
3.42 |
1244.87 |
10.5.8 |
4147.77 |
3.86 |
851.98 |
10.5.8p |
7106.93 |
2.25 |
139.15 |
The last line was produced with the following fix:
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
|
--- a/storage/innobase/buf/buf0flu.cc
|
+++ b/storage/innobase/buf/buf0flu.cc
|
@@ -2086,6 +2086,12 @@ static os_thread_ret_t DECLARE_THREAD(buf_flush_page_cleaner)(void*)
|
const double dirty_pct= double(dirty_blocks) * 100.0 /
|
double(UT_LIST_GET_LEN(buf_pool.LRU) + UT_LIST_GET_LEN(buf_pool.free));
|
|
+ if (dirty_pct < srv_max_buf_pool_modified_pct)
|
+ continue;
|
+
|
+ if (srv_max_dirty_pages_pct_lwm == 0.0)
|
+ continue;
|
+
|
if (dirty_pct < srv_max_dirty_pages_pct_lwm)
|
continue;
|
|
This above patch is only applicable to 10.5.7 and 10.5.8 only; the code was slightly refactored in MDEV-24278 since then.
I believe that a work-around of this regression is to set innodb_max_dirty_pages_pct_lwm to the same value as innodb_max_dirty_pages_pct (default value: 90).
Side note: The parameter innodb_idle_flush_pct has no effect (MDEV-24536).
{"report":{"fcp":1754.0999999046326,"ttfb":495.40000009536743,"pageVisibility":"visible","entityId":95647,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"ec7d90fc-4840-495c-b9e4-9d6c7aef413b","navigationType":0,"readyForUser":1904.1999998092651,"redirectCount":0,"resourceLoadedEnd":1375.3000001907349,"resourceLoadedStart":507.80000019073486,"resourceTiming":[{"duration":15.299999713897705,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":507.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":507.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":523.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":15.300000190734863,"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":508.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":508.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":523.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":499.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":508.40000009536743,"connectEnd":508.40000009536743,"connectStart":508.40000009536743,"domainLookupEnd":508.40000009536743,"domainLookupStart":508.40000009536743,"fetchStart":508.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":525.0999999046326,"responseEnd":1008.0999999046326,"responseStart":557,"secureConnectionStart":508.40000009536743},{"duration":865.8000001907349,"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":509.5,"connectEnd":509.5,"connectStart":509.5,"domainLookupEnd":509.5,"domainLookupStart":509.5,"fetchStart":509.5,"redirectEnd":0,"redirectStart":0,"requestStart":534.3000001907349,"responseEnd":1375.3000001907349,"responseStart":578,"secureConnectionStart":509.5},{"duration":79.40000009536743,"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":509.69999980926514,"connectEnd":509.69999980926514,"connectStart":509.69999980926514,"domainLookupEnd":509.69999980926514,"domainLookupStart":509.69999980926514,"fetchStart":509.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":545.1999998092651,"responseEnd":589.0999999046326,"responseStart":583.6999998092651,"secureConnectionStart":509.69999980926514},{"duration":92.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":509.90000009536743,"connectEnd":509.90000009536743,"connectStart":509.90000009536743,"domainLookupEnd":509.90000009536743,"domainLookupStart":509.90000009536743,"fetchStart":509.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":555.6999998092651,"responseEnd":602.4000000953674,"responseStart":595.9000000953674,"secureConnectionStart":509.90000009536743},{"duration":92.59999990463257,"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":510,"connectEnd":510,"connectStart":510,"domainLookupEnd":510,"domainLookupStart":510,"fetchStart":510,"redirectEnd":0,"redirectStart":0,"requestStart":556.8000001907349,"responseEnd":602.5999999046326,"responseStart":600,"secureConnectionStart":510},{"duration":30.5,"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":510.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":510.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":540.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":100.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":510.30000019073486,"connectEnd":510.30000019073486,"connectStart":510.30000019073486,"domainLookupEnd":510.30000019073486,"domainLookupStart":510.30000019073486,"fetchStart":510.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":563.4000000953674,"responseEnd":611,"responseStart":602.6999998092651,"secureConnectionStart":510.30000019073486},{"duration":35.30000019073486,"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":510.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":510.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":545.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":100.90000009536743,"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":510.69999980926514,"connectEnd":510.69999980926514,"connectStart":510.69999980926514,"domainLookupEnd":510.69999980926514,"domainLookupStart":510.69999980926514,"fetchStart":510.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":564.3000001907349,"responseEnd":611.5999999046326,"responseStart":603.3000001907349,"secureConnectionStart":510.69999980926514},{"duration":790.0999999046326,"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":513,"connectEnd":513,"connectStart":513,"domainLookupEnd":513,"domainLookupStart":513,"fetchStart":513,"redirectEnd":0,"redirectStart":0,"requestStart":583.5,"responseEnd":1303.0999999046326,"responseStart":1299.9000000953674,"secureConnectionStart":513},{"duration":790.3000001907349,"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":513.0999999046326,"connectEnd":513.0999999046326,"connectStart":513.0999999046326,"domainLookupEnd":513.0999999046326,"domainLookupStart":513.0999999046326,"fetchStart":513.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":615,"responseEnd":1303.4000000953674,"responseStart":1300.8000001907349,"secureConnectionStart":513.0999999046326},{"duration":199.40000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1268.5999999046326,"connectEnd":1268.5999999046326,"connectStart":1268.5999999046326,"domainLookupEnd":1268.5999999046326,"domainLookupStart":1268.5999999046326,"fetchStart":1268.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1436.4000000953674,"responseEnd":1468,"responseStart":1467.3000001907349,"secureConnectionStart":1268.5999999046326}],"fetchStart":0,"domainLookupStart":12,"domainLookupEnd":59,"connectStart":60,"connectEnd":79,"secureConnectionStart":68,"requestStart":80,"responseStart":495,"responseEnd":510,"domLoading":499,"domInteractive":1986,"domContentLoadedEventStart":1986,"domContentLoadedEventEnd":2077,"domComplete":2719,"loadEventStart":2719,"loadEventEnd":2720,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1954.5},{"name":"bigPipe.sidebar-id.end","time":1955.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.start","time":1955.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":1957.1999998092651},{"name":"activityTabFullyLoaded","time":2171.300000190735}],"measures":[],"correlationId":"ba00b5863c8e25","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":308,"dbReadsTimeInMs":20,"dbConnsTimeInMs":30,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I think that the default behavior of MariaDB 10.5.7 and 10.5.8 can be emulated by the following: