Thanks knielsen:
I happened upon this patch of yours:
MDEV-24670 memory pressure - eventfd rather than pipe
@@ -896,7 +894,7 @@ void mem_pressure::pressure_routine(mem_pressure *m)
|
}
|
|
ulonglong last= microsecond_interval_timer() - max_interval_us;
|
- while (1)
|
+ while (!m->m_abort)
|
{
|
if (poll(&m->m_fds[0], m->m_num_fds, -1) < 0)
|
{
|
@@ -909,6 +907,9 @@ void mem_pressure::pressure_routine(mem_pressure *m)
|
break;
|
}
|
}
|
+ if (!m->m_abort)
|
+ break;
|
+
|
Is it just me, or isn't that if (!m->m_abort) condition inverted? This seems to mean that the thread will never do anything, it will exit immediately the first time it gets any activity on the fd out of poll()?
{"report":{"fcp":820.4000000059605,"ttfb":240.29999999701977,"pageVisibility":"visible","entityId":130336,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"a2709fa6-e5c3-4e7d-a9e2-3a8722d9c13a","navigationType":0,"readyForUser":900.2000000029802,"redirectCount":0,"resourceLoadedEnd":929.4000000059605,"resourceLoadedStart":245.70000000298023,"resourceTiming":[{"duration":24.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":245.70000000298023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":245.70000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":270.20000000298023,"responseStart":0,"secureConnectionStart":0},{"duration":24.700000002980232,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":245.90000000596046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":245.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":270.6000000089407,"responseStart":0,"secureConnectionStart":0},{"duration":83.09999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":246.1000000089407,"connectEnd":246.1000000089407,"connectStart":246.1000000089407,"domainLookupEnd":246.1000000089407,"domainLookupStart":246.1000000089407,"fetchStart":246.1000000089407,"redirectEnd":0,"redirectStart":0,"requestStart":246.1000000089407,"responseEnd":329.20000000298023,"responseStart":329.20000000298023,"secureConnectionStart":246.1000000089407},{"duration":152.79999999701977,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":246.20000000298023,"connectEnd":246.20000000298023,"connectStart":246.20000000298023,"domainLookupEnd":246.20000000298023,"domainLookupStart":246.20000000298023,"fetchStart":246.20000000298023,"redirectEnd":0,"redirectStart":0,"requestStart":246.20000000298023,"responseEnd":399,"responseStart":398.90000000596046,"secureConnectionStart":246.20000000298023},{"duration":155.79999999701977,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":246.40000000596046,"connectEnd":246.40000000596046,"connectStart":246.40000000596046,"domainLookupEnd":246.40000000596046,"domainLookupStart":246.40000000596046,"fetchStart":246.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":246.40000000596046,"responseEnd":402.20000000298023,"responseStart":402.20000000298023,"secureConnectionStart":246.40000000596046},{"duration":156,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":246.6000000089407,"connectEnd":246.6000000089407,"connectStart":246.6000000089407,"domainLookupEnd":246.6000000089407,"domainLookupStart":246.6000000089407,"fetchStart":246.6000000089407,"redirectEnd":0,"redirectStart":0,"requestStart":246.6000000089407,"responseEnd":402.6000000089407,"responseStart":402.6000000089407,"secureConnectionStart":246.6000000089407},{"duration":156.1000000089407,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":246.79999999701977,"connectEnd":246.79999999701977,"connectStart":246.79999999701977,"domainLookupEnd":246.79999999701977,"domainLookupStart":246.79999999701977,"fetchStart":246.79999999701977,"redirectEnd":0,"redirectStart":0,"requestStart":246.79999999701977,"responseEnd":402.90000000596046,"responseStart":402.90000000596046,"secureConnectionStart":246.79999999701977},{"duration":218.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":247,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":247,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":465.5,"responseStart":0,"secureConnectionStart":0},{"duration":156.19999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":247.1000000089407,"connectEnd":247.1000000089407,"connectStart":247.1000000089407,"domainLookupEnd":247.1000000089407,"domainLookupStart":247.1000000089407,"fetchStart":247.1000000089407,"redirectEnd":0,"redirectStart":0,"requestStart":247.1000000089407,"responseEnd":403.29999999701977,"responseStart":403.29999999701977,"secureConnectionStart":247.1000000089407},{"duration":218.30000001192093,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/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":247.29999999701977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":247.29999999701977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":465.6000000089407,"responseStart":0,"secureConnectionStart":0},{"duration":156.3999999910593,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/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":247.40000000596046,"connectEnd":247.40000000596046,"connectStart":247.40000000596046,"domainLookupEnd":247.40000000596046,"domainLookupStart":247.40000000596046,"fetchStart":247.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":247.40000000596046,"responseEnd":403.79999999701977,"responseStart":403.79999999701977,"secureConnectionStart":247.40000000596046},{"duration":401.3999999910593,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":248.40000000596046,"connectEnd":248.40000000596046,"connectStart":248.40000000596046,"domainLookupEnd":248.40000000596046,"domainLookupStart":248.40000000596046,"fetchStart":248.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":248.40000000596046,"responseEnd":649.7999999970198,"responseStart":649.7999999970198,"secureConnectionStart":248.40000000596046},{"duration":607.8999999910593,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":248.40000000596046,"connectEnd":248.40000000596046,"connectStart":248.40000000596046,"domainLookupEnd":248.40000000596046,"domainLookupStart":248.40000000596046,"fetchStart":248.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":248.40000000596046,"responseEnd":856.2999999970198,"responseStart":856.2999999970198,"secureConnectionStart":248.40000000596046},{"duration":173.70000000298023,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":476.29999999701977,"connectEnd":476.29999999701977,"connectStart":476.29999999701977,"domainLookupEnd":476.29999999701977,"domainLookupStart":476.29999999701977,"fetchStart":476.29999999701977,"redirectEnd":0,"redirectStart":0,"requestStart":476.29999999701977,"responseEnd":650,"responseStart":650,"secureConnectionStart":476.29999999701977},{"duration":186.6000000089407,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bv2/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":742.7999999970198,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":742.7999999970198,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":929.4000000059605,"responseStart":0,"secureConnectionStart":0},{"duration":248.29999999701977,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/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":743.7000000029802,"connectEnd":743.7000000029802,"connectStart":743.7000000029802,"domainLookupEnd":743.7000000029802,"domainLookupStart":743.7000000029802,"fetchStart":743.7000000029802,"redirectEnd":0,"redirectStart":0,"requestStart":743.7000000029802,"responseEnd":992,"responseStart":992,"secureConnectionStart":743.7000000029802},{"duration":253.59999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/53a43b6764f587426c7bb9a150184c00-CDN/lu2bv2/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":744.1000000089407,"connectEnd":744.1000000089407,"connectStart":744.1000000089407,"domainLookupEnd":744.1000000089407,"domainLookupStart":744.1000000089407,"fetchStart":744.1000000089407,"redirectEnd":0,"redirectStart":0,"requestStart":744.1000000089407,"responseEnd":997.7000000029802,"responseStart":997.7000000029802,"secureConnectionStart":744.1000000089407}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":54,"responseStart":241,"responseEnd":243,"domLoading":243,"domInteractive":964,"domContentLoadedEventStart":964,"domContentLoadedEventEnd":1004,"domComplete":1274,"loadEventStart":1274,"loadEventEnd":1275,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":941.6000000089407},{"name":"bigPipe.sidebar-id.end","time":942.2000000029802},{"name":"bigPipe.activity-panel-pipe-id.start","time":942.2999999970198},{"name":"bigPipe.activity-panel-pipe-id.end","time":944.1000000089407},{"name":"activityTabFullyLoaded","time":1030}],"measures":[],"correlationId":"a08026539099a7","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":121,"dbReadsTimeInMs":21,"dbConnsTimeInMs":30,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The current triggers are:
https://github.com/MariaDB/server/blob/mariadb-10.11.9/storage/innobase/buf/buf0buf.cc#L873-L880
If there is some memory pressure for 5/10 seconds, or there is full memory pressure for 10ms out of 2 seconds.
Details as what these mean are https://docs.kernel.org/accounting/psi.html.
I didn't include which was actually triggering in the logs, would be a simple enough change.
The response in https://github.com/MariaDB/server/blob/mariadb-10.11.9/storage/innobase/buf/buf0buf.cc#L2174 is a madvise(MADV_FREE) which allows the memory to be claimed by the kernel.
So larger questions is there a MariaDB performance impact apart from generating log messages every few hours? Would the a kernel killing MariaDB due to an out of memory event otherwise? And if both are true, is there a fine tuning of the trigger, that can accommodate both.
If you graph the memory resident use of MariaDB does it and by how much during these memory pressure events.