While actually trying to analyze something else I found that PERFORMANCE_SCHEMA.THREADS does not list all server threads.
In my case I was originally looking for InnoDB background encryption threads, of which I had four configured, but found that there were actually five threads missing.
ps showed:
$ pgrep -w mariadbd | xargs ps -Lo pid,lwp,cmd
|
PID LWP CMD
|
14728 14728 /usr/sbin/mariadbd
|
14728 14729 /usr/sbin/mariadbd
|
14728 14730 /usr/sbin/mariadbd
|
14728 14731 /usr/sbin/mariadbd
|
14728 14732 /usr/sbin/mariadbd
|
14728 14735 /usr/sbin/mariadbd
|
14728 14736 /usr/sbin/mariadbd
|
14728 14737 /usr/sbin/mariadbd
|
14728 14738 /usr/sbin/mariadbd
|
14728 14739 /usr/sbin/mariadbd
|
14728 14740 /usr/sbin/mariadbd
|
14728 14742 /usr/sbin/mariadbd
|
14728 15299 /usr/sbin/mariadbd
|
14728 15383 /usr/sbin/mariadbd
|
But the THREADS table only had:
MariaDB [test]> select name, thread_os_id from performance_schema.threads order by thread_os_id;
|
+-----------------------------------+--------------+
|
| name | thread_os_id |
|
+-----------------------------------+--------------+
|
| thread/sql/main | 14728 |
|
| thread/mysys/statement_timer | 14729 |
|
| thread/aria/checkpoint_background | 14730 |
|
| thread/innodb/page_cleaner_thread | 14732 |
|
| thread/sql/manager | 14739 |
|
| thread/sql/binlog_background | 14740 |
|
| thread/sql/signal_handler | 14742 |
|
| thread/innodb/thread_pool_thread | 15299 |
|
| thread/sql/one_connection | 15383 |
|
+-----------------------------------+--------------+
|
So LWP ides 14731 and 14835-14738 were missing. The later four are the background encryption threads, and 14731 was running this according to gdb:
Thread 4 (Thread 0x7fa945118700 (LWP 14731)):
|
#0 syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
|
#1 0x000055faa5f1213d in my_getevents (min_nr=1, nr=256, ev=0x7fa945115d60, ctx=<optimized out>) at ./tpool/aio_linux.cc:105
|
#2 tpool::aio_linux::getevent_thread_routine (aio=0x55faa8c4e650) at ./tpool/aio_linux.cc:105
|
#3 0x00007fa96107bdf4 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
|
#4 0x00007fa961195609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#5 0x00007fa960d81353 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Not sure whether it is only these threads that do not show, or whether there are also other candidates that were just not running in this setup to begin with.
- relates to
-
MDEV-36189
P_S.THREADS is still not showing all server threads in 11.4.5
-
-
Open
{"report":{"fcp":1614.5,"ttfb":730.2999999523163,"pageVisibility":"visible","entityId":128880,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"8b8d307d-2f4e-4c0d-b104-49c07f34bddb","navigationType":0,"readyForUser":1701.9000000953674,"redirectCount":0,"resourceLoadedEnd":2032.5999999046326,"resourceLoadedStart":736.2000000476837,"resourceTiming":[{"duration":353.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":736.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":736.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1089.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":353.59999990463257,"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":736.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":736.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1090.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":372.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":736.7000000476837,"connectEnd":736.7000000476837,"connectStart":736.7000000476837,"domainLookupEnd":736.7000000476837,"domainLookupStart":736.7000000476837,"fetchStart":736.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":736.7000000476837,"responseEnd":1109.2999999523163,"responseStart":1109.2999999523163,"secureConnectionStart":736.7000000476837},{"duration":440.2999999523163,"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":736.9000000953674,"connectEnd":736.9000000953674,"connectStart":736.9000000953674,"domainLookupEnd":736.9000000953674,"domainLookupStart":736.9000000953674,"fetchStart":736.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":736.9000000953674,"responseEnd":1177.2000000476837,"responseStart":1177.2000000476837,"secureConnectionStart":736.9000000953674},{"duration":444.30000019073486,"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":737.0999999046326,"connectEnd":737.0999999046326,"connectStart":737.0999999046326,"domainLookupEnd":737.0999999046326,"domainLookupStart":737.0999999046326,"fetchStart":737.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":737.0999999046326,"responseEnd":1181.4000000953674,"responseStart":1181.4000000953674,"secureConnectionStart":737.0999999046326},{"duration":444.7000000476837,"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":737.2999999523163,"connectEnd":737.2999999523163,"connectStart":737.2999999523163,"domainLookupEnd":737.2999999523163,"domainLookupStart":737.2999999523163,"fetchStart":737.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":737.2999999523163,"responseEnd":1182,"responseStart":1182,"secureConnectionStart":737.2999999523163},{"duration":444.90000009536743,"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":737.5,"connectEnd":737.5,"connectStart":737.5,"domainLookupEnd":737.5,"domainLookupStart":737.5,"fetchStart":737.5,"redirectEnd":0,"redirectStart":0,"requestStart":737.5,"responseEnd":1182.4000000953674,"responseStart":1182.4000000953674,"secureConnectionStart":737.5},{"duration":519.0999999046326,"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":737.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":737.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1256.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":445.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":737.7999999523163,"connectEnd":737.7999999523163,"connectStart":737.7999999523163,"domainLookupEnd":737.7999999523163,"domainLookupStart":737.7999999523163,"fetchStart":737.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":737.7999999523163,"responseEnd":1182.9000000953674,"responseStart":1182.9000000953674,"secureConnectionStart":737.7999999523163},{"duration":518.9000000953674,"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":738.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":738.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1257,"responseStart":0,"secureConnectionStart":0},{"duration":445.2999999523163,"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":738.2000000476837,"connectEnd":738.2000000476837,"connectStart":738.2000000476837,"domainLookupEnd":738.2000000476837,"domainLookupStart":738.2000000476837,"fetchStart":738.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":738.2000000476837,"responseEnd":1183.5,"responseStart":1183.5,"secureConnectionStart":738.2000000476837},{"duration":802.7000000476837,"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":739.0999999046326,"connectEnd":739.0999999046326,"connectStart":739.0999999046326,"domainLookupEnd":739.0999999046326,"domainLookupStart":739.0999999046326,"fetchStart":739.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":739.0999999046326,"responseEnd":1541.7999999523163,"responseStart":1541.7999999523163,"secureConnectionStart":739.0999999046326},{"duration":1288.8999998569489,"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":743.7000000476837,"connectEnd":743.7000000476837,"connectStart":743.7000000476837,"domainLookupEnd":743.7000000476837,"domainLookupStart":743.7000000476837,"fetchStart":743.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":743.7000000476837,"responseEnd":2032.5999999046326,"responseStart":2032.5999999046326,"secureConnectionStart":743.7000000476837},{"duration":275.10000014305115,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1269.7999999523163,"connectEnd":1269.7999999523163,"connectStart":1269.7999999523163,"domainLookupEnd":1269.7999999523163,"domainLookupStart":1269.7999999523163,"fetchStart":1269.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":1269.7999999523163,"responseEnd":1544.9000000953674,"responseStart":1544.9000000953674,"secureConnectionStart":1269.7999999523163}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":563,"responseStart":730,"responseEnd":735,"domLoading":734,"domInteractive":2054,"domContentLoadedEventStart":2054,"domContentLoadedEventEnd":2099,"domComplete":2997,"loadEventStart":2997,"loadEventEnd":2998,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2034.4000000953674},{"name":"bigPipe.sidebar-id.end","time":2035.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":2035.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":2037.0999999046326},{"name":"activityTabFullyLoaded","time":2117}],"measures":[],"correlationId":"b4eb44981105c","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":103,"dbReadsTimeInMs":12,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
because encryption threads are created using std::thread which completely bypasses perfschema.
should be converted to use the thread pool, I presume