Using Intel® VTune™ Amplifier on MySQL Server

Published: 04/23/2019

By Alexandra Marie Shinsel

Problem:
Attempting to profile MySQL server with Intel® VTune™ Amplifier's user-mode sampling collector produces unexpected behavior such as empty results or "access denied" errors:

mysqlslap: Error when connecting to server: Access denied for user 'root'@'localhost' (using password: NO)

Root Cause:
In general, you need to use a benchmark to keep MySQL server busy for profiling purposes, otherwise you will end up with an empty result. Further, the user-mode sampling collector can fail when MySQL server starts from a different account than VTune Amplifier is being run from (e.g. MySQL server starts from the "mysql" user account, but VTune Amplifier is being run as the "root" user).

Solution:
Shut down the mysql process if it exists, then start mySQL from the user account you will be running VTune Amplifier under (in this example, "root"). Be sure to use a benchmark (in this example, mysqlslap) to ensure that there is activity to profile.

mysqld_safe --user=root --skip-grant-tables --skip-networking &
mysqlslap --user=root --auto-generate-sql --iterations=10000 &
amplxe-cl --collect hotspots --duration 30 --target-pid 12345

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.