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":1241.3000001907349,"ttfb":417.1000003814697,"pageVisibility":"visible","entityId":95647,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"f5951852-1a5c-4747-af10-11dddc4ebcad","navigationType":0,"readyForUser":1333.6000003814697,"redirectCount":0,"resourceLoadedEnd":935.3000001907349,"resourceLoadedStart":427.1000003814697,"resourceTiming":[{"duration":117.7999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":427.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":427.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":544.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":117.90000009536743,"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":427.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":427.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":545.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":341,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":427.6000003814697,"connectEnd":427.6000003814697,"connectStart":427.6000003814697,"domainLookupEnd":427.6000003814697,"domainLookupStart":427.6000003814697,"fetchStart":427.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":546.8000001907349,"responseEnd":768.6000003814697,"responseStart":563.2000002861023,"secureConnectionStart":427.6000003814697},{"duration":507,"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":428.30000019073486,"connectEnd":428.30000019073486,"connectStart":428.30000019073486,"domainLookupEnd":428.30000019073486,"domainLookupStart":428.30000019073486,"fetchStart":428.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":547.2000002861023,"responseEnd":935.3000001907349,"responseStart":566.4000000953674,"secureConnectionStart":428.30000019073486},{"duration":178.5,"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":428.5,"connectEnd":428.5,"connectStart":428.5,"domainLookupEnd":428.5,"domainLookupStart":428.5,"fetchStart":428.5,"redirectEnd":0,"redirectStart":0,"requestStart":574.3000001907349,"responseEnd":607,"responseStart":601.7000002861023,"secureConnectionStart":428.5},{"duration":179,"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":428.7000002861023,"connectEnd":428.7000002861023,"connectStart":428.7000002861023,"domainLookupEnd":428.7000002861023,"domainLookupStart":428.7000002861023,"fetchStart":428.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":574.5,"responseEnd":607.7000002861023,"responseStart":603.1000003814697,"secureConnectionStart":428.7000002861023},{"duration":179.19999980926514,"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":428.80000019073486,"connectEnd":428.80000019073486,"connectStart":428.80000019073486,"domainLookupEnd":428.80000019073486,"domainLookupStart":428.80000019073486,"fetchStart":428.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":574.6000003814697,"responseEnd":608,"responseStart":603.8000001907349,"secureConnectionStart":428.80000019073486},{"duration":140.90000009536743,"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":429,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":429,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":569.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":179,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":429.2000002861023,"connectEnd":429.2000002861023,"connectStart":429.2000002861023,"domainLookupEnd":429.2000002861023,"domainLookupStart":429.2000002861023,"fetchStart":429.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":574.8000001907349,"responseEnd":608.2000002861023,"responseStart":604.5,"secureConnectionStart":429.2000002861023},{"duration":140.7000002861023,"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":429.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":429.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":570.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":178.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":429.40000009536743,"connectEnd":429.40000009536743,"connectStart":429.40000009536743,"domainLookupEnd":429.40000009536743,"domainLookupStart":429.40000009536743,"fetchStart":429.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":574.9000000953674,"responseEnd":608.3000001907349,"responseStart":605.5,"secureConnectionStart":429.40000009536743},{"duration":482.09999990463257,"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":431.80000019073486,"connectEnd":431.80000019073486,"connectStart":431.80000019073486,"domainLookupEnd":431.80000019073486,"domainLookupStart":431.80000019073486,"fetchStart":431.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":682.1000003814697,"responseEnd":913.9000000953674,"responseStart":907.3000001907349,"secureConnectionStart":431.80000019073486},{"duration":482.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":431.90000009536743,"connectEnd":431.90000009536743,"connectStart":431.90000009536743,"domainLookupEnd":431.90000009536743,"domainLookupStart":431.90000009536743,"fetchStart":431.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":759.9000000953674,"responseEnd":914.4000000953674,"responseStart":908.7000002861023,"secureConnectionStart":431.90000009536743},{"duration":161.90000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":920.2000002861023,"connectEnd":920.2000002861023,"connectStart":920.2000002861023,"domainLookupEnd":920.2000002861023,"domainLookupStart":920.2000002861023,"fetchStart":920.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1050,"responseEnd":1082.1000003814697,"responseStart":1081.1000003814697,"secureConnectionStart":920.2000002861023}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":236,"responseStart":417,"responseEnd":428,"domLoading":421,"domInteractive":1398,"domContentLoadedEventStart":1398,"domContentLoadedEventEnd":1450,"domComplete":2470,"loadEventStart":2470,"loadEventEnd":2471,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1377.4000000953674},{"name":"bigPipe.sidebar-id.end","time":1378.1000003814697},{"name":"bigPipe.activity-panel-pipe-id.start","time":1378.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1381.3000001907349},{"name":"activityTabFullyLoaded","time":1459.1000003814697}],"measures":[],"correlationId":"c61f447f9301ba","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":107,"dbReadsTimeInMs":20,"dbConnsTimeInMs":30,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}