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":1299.8000001907349,"ttfb":298.30000019073486,"pageVisibility":"visible","entityId":95647,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"031300e1-80d3-4d85-998e-0408f0714297","navigationType":0,"readyForUser":1452.8000001907349,"redirectCount":0,"resourceLoadedEnd":999.3000001907349,"resourceLoadedStart":310.40000009536743,"resourceTiming":[{"duration":40.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":310.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":310.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":351.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":41,"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":310.60000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":310.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":351.60000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":573.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":310.80000019073486,"connectEnd":310.80000019073486,"connectStart":310.80000019073486,"domainLookupEnd":310.80000019073486,"domainLookupStart":310.80000019073486,"fetchStart":310.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":353.60000014305115,"responseEnd":884.4000000953674,"responseStart":554.4000000953674,"secureConnectionStart":310.80000019073486},{"duration":688.4000000953674,"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":310.90000009536743,"connectEnd":310.90000009536743,"connectStart":310.90000009536743,"domainLookupEnd":310.90000009536743,"domainLookupStart":310.90000009536743,"fetchStart":310.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":353.80000019073486,"responseEnd":999.3000001907349,"responseStart":493.60000014305115,"secureConnectionStart":310.90000009536743},{"duration":186.60000014305115,"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":311.2000000476837,"connectEnd":311.2000000476837,"connectStart":311.2000000476837,"domainLookupEnd":311.2000000476837,"domainLookupStart":311.2000000476837,"fetchStart":311.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":354,"responseEnd":497.80000019073486,"responseStart":494.60000014305115,"secureConnectionStart":311.2000000476837},{"duration":190.79999995231628,"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":311.2000000476837,"connectEnd":311.2000000476837,"connectStart":311.2000000476837,"domainLookupEnd":311.2000000476837,"domainLookupStart":311.2000000476837,"fetchStart":311.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":354.2000000476837,"responseEnd":502,"responseStart":496.10000014305115,"secureConnectionStart":311.2000000476837},{"duration":190.70000004768372,"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":311.5,"connectEnd":311.5,"connectStart":311.5,"domainLookupEnd":311.5,"domainLookupStart":311.5,"fetchStart":311.5,"redirectEnd":0,"redirectStart":0,"requestStart":354.30000019073486,"responseEnd":502.2000000476837,"responseStart":498,"secureConnectionStart":311.5},{"duration":40.69999980926514,"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":311.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":311.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":352.5,"responseStart":0,"secureConnectionStart":0},{"duration":190.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":311.90000009536743,"connectEnd":311.90000009536743,"connectStart":311.90000009536743,"domainLookupEnd":311.90000009536743,"domainLookupStart":311.90000009536743,"fetchStart":311.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":355.10000014305115,"responseEnd":502.5,"responseStart":498.80000019073486,"secureConnectionStart":311.90000009536743},{"duration":40.90000009536743,"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":312,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":312,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":352.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":190.5,"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":312.2000000476837,"connectEnd":312.2000000476837,"connectStart":312.2000000476837,"domainLookupEnd":312.2000000476837,"domainLookupStart":312.2000000476837,"fetchStart":312.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":360.40000009536743,"responseEnd":502.7000000476837,"responseStart":499.90000009536743,"secureConnectionStart":312.2000000476837},{"duration":682.2999999523163,"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":313.40000009536743,"connectEnd":313.40000009536743,"connectStart":313.40000009536743,"domainLookupEnd":313.40000009536743,"domainLookupStart":313.40000009536743,"fetchStart":313.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":383.5,"responseEnd":995.7000000476837,"responseStart":989.8000001907349,"secureConnectionStart":313.40000009536743},{"duration":683.1000001430511,"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":313.5,"connectEnd":313.5,"connectStart":313.5,"domainLookupEnd":313.5,"domainLookupStart":313.5,"fetchStart":313.5,"redirectEnd":0,"redirectStart":0,"requestStart":408.7000000476837,"responseEnd":996.6000001430511,"responseStart":992.7000000476837,"secureConnectionStart":313.5},{"duration":15.400000095367432,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1024.5,"connectEnd":1024.5,"connectStart":1024.5,"domainLookupEnd":1024.5,"domainLookupStart":1024.5,"fetchStart":1024.5,"redirectEnd":0,"redirectStart":0,"requestStart":1024.5,"responseEnd":1039.9000000953674,"responseStart":1039.9000000953674,"secureConnectionStart":1024.5},{"duration":227.09999990463257,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1289.8000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1289.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1516.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":197,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1317.9000000953674,"connectEnd":1317.9000000953674,"connectStart":1317.9000000953674,"domainLookupEnd":1317.9000000953674,"domainLookupStart":1317.9000000953674,"fetchStart":1317.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1317.9000000953674,"responseEnd":1514.9000000953674,"responseStart":1514.9000000953674,"secureConnectionStart":1317.9000000953674}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":101,"responseStart":298,"responseEnd":315,"domLoading":308,"domInteractive":1527,"domContentLoadedEventStart":1527,"domContentLoadedEventEnd":1570,"domComplete":2080,"loadEventStart":2080,"loadEventEnd":2080,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1500.7000000476837},{"name":"bigPipe.sidebar-id.end","time":1501.6000001430511},{"name":"bigPipe.activity-panel-pipe-id.start","time":1501.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":1503},{"name":"activityTabFullyLoaded","time":1593.9000000953674}],"measures":[],"correlationId":"522b422eee1f82","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":111,"dbReadsTimeInMs":19,"dbConnsTimeInMs":30,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
After the
MDEV-24917fix, the performance is similar, on the same hardware:MDEV-24917