Percona added support to map processlist ids to OS thread ids through column TID of the information_schema.processlist table starting on Percona Server for MySQL 5.6.27. With the release of 5.7, MySQL followed with its own implementation by extending the PERFORMANCE_SCHEMA.THREADS table and adding a new column named THREAD_OS_ID, which Percona Server for MySQL adopted in place of its own, as it usually does remain as close to upstream as possible.
The following approach is useful for cases where there is a query overloading one particular CPU while other cores are performing normally.
pidstat
on the Host VM.# nsenter --target "$(pidof mysqld)" -m pidstat -tAnd then the THREAD_OS_ID’s should line up with the pidstat output
mysql/b73967e5-5720-4b64-b6aa-d226f2fa4cdd:~# mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnfQuery
mysql> select * from performance_schema.threads where THREAD_OS_ID = 74 \G