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":879.0999999046326,"ttfb":270.59999990463257,"pageVisibility":"visible","entityId":128880,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"f6472f7f-5485-4a66-a968-a4fd680c7717","navigationType":0,"readyForUser":960.5999999046326,"redirectCount":0,"resourceLoadedEnd":614.2999997138977,"resourceLoadedStart":276.5,"resourceTiming":[{"duration":68.7999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":276.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":276.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":345.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":74.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":276.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":276.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":351.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":222,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":277,"connectEnd":277,"connectStart":277,"domainLookupEnd":277,"domainLookupStart":277,"fetchStart":277,"redirectEnd":0,"redirectStart":0,"requestStart":356.09999990463257,"responseEnd":499,"responseStart":373.7999997138977,"secureConnectionStart":277},{"duration":337.19999980926514,"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":277.09999990463257,"connectEnd":277.09999990463257,"connectStart":277.09999990463257,"domainLookupEnd":277.09999990463257,"domainLookupStart":277.09999990463257,"fetchStart":277.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":355.8999996185303,"responseEnd":614.2999997138977,"responseStart":372.19999980926514,"secureConnectionStart":277.09999990463257},{"duration":99.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":277.2999997138977,"connectEnd":277.2999997138977,"connectStart":277.2999997138977,"domainLookupEnd":277.2999997138977,"domainLookupStart":277.2999997138977,"fetchStart":277.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":356.2999997138977,"responseEnd":376.7999997138977,"responseStart":375,"secureConnectionStart":277.2999997138977},{"duration":107.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":277.5,"connectEnd":277.5,"connectStart":277.5,"domainLookupEnd":277.5,"domainLookupStart":277.5,"fetchStart":277.5,"redirectEnd":0,"redirectStart":0,"requestStart":362.5,"responseEnd":385,"responseStart":380.8999996185303,"secureConnectionStart":277.5},{"duration":103.09999990463257,"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":277.59999990463257,"connectEnd":277.59999990463257,"connectStart":277.59999990463257,"domainLookupEnd":277.59999990463257,"domainLookupStart":277.59999990463257,"fetchStart":277.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":361.3999996185303,"responseEnd":380.69999980926514,"responseStart":378.59999990463257,"secureConnectionStart":277.59999990463257},{"duration":78.80000019073486,"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":277.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":277.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":356.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":107.60000038146973,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":277.8999996185303,"connectEnd":277.8999996185303,"connectStart":277.8999996185303,"domainLookupEnd":277.8999996185303,"domainLookupStart":277.8999996185303,"fetchStart":277.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":362.7999997138977,"responseEnd":385.5,"responseStart":381.69999980926514,"secureConnectionStart":277.8999996185303},{"duration":81.59999990463257,"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":278.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":278.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":359.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":115.2000002861023,"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":278.2999997138977,"connectEnd":278.2999997138977,"connectStart":278.2999997138977,"domainLookupEnd":278.2999997138977,"domainLookupStart":278.2999997138977,"fetchStart":278.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":364.2999997138977,"responseEnd":393.5,"responseStart":384.19999980926514,"secureConnectionStart":278.2999997138977},{"duration":279,"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":284.09999990463257,"connectEnd":284.09999990463257,"connectStart":284.09999990463257,"domainLookupEnd":284.09999990463257,"domainLookupStart":284.09999990463257,"fetchStart":284.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":451,"responseEnd":563.0999999046326,"responseStart":560.1999998092651,"secureConnectionStart":284.09999990463257},{"duration":279.2000002861023,"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":284.3999996185303,"connectEnd":284.3999996185303,"connectStart":284.3999996185303,"domainLookupEnd":284.3999996185303,"domainLookupStart":284.3999996185303,"fetchStart":284.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":530.3999996185303,"responseEnd":563.5999999046326,"responseStart":561.3999996185303,"secureConnectionStart":284.3999996185303},{"duration":221.39999961853027,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":630,"connectEnd":630,"connectStart":630,"domainLookupEnd":630,"domainLookupStart":630,"fetchStart":630,"redirectEnd":0,"redirectStart":0,"requestStart":814.7999997138977,"responseEnd":851.3999996185303,"responseStart":849.2999997138977,"secureConnectionStart":630},{"duration":183.40000009536743,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":871.1999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":871.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1054.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":197.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":894,"connectEnd":894,"connectStart":894,"domainLookupEnd":894,"domainLookupStart":894,"fetchStart":894,"redirectEnd":0,"redirectStart":0,"requestStart":1060.7999997138977,"responseEnd":1091.5,"responseStart":1090.3999996185303,"secureConnectionStart":894}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":81,"responseStart":270,"responseEnd":283,"domLoading":274,"domInteractive":1079,"domContentLoadedEventStart":1079,"domContentLoadedEventEnd":1134,"domComplete":1546,"loadEventStart":1546,"loadEventEnd":1547,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1056.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1057.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1057.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1059.1999998092651},{"name":"activityTabFullyLoaded","time":1153.2999997138977}],"measures":[],"correlationId":"46b9200b908d30","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":115,"dbReadsTimeInMs":10,"dbConnsTimeInMs":19,"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