Starting with InnoDB 1.1 with MySQL 5.5, you can profile certain internal InnoDB operations using the MySQL Performance Schema feature. This type of tuning is primarily for expert users, those who push the limits of MySQL performance, read the MySQL source code, and evaluate optimization strategies to overcome performance bottlenecks. DBAs can also use this feature for capacity planning, to see whether their typical workload encounters any performance bottlenecks with a particular combination of CPU, RAM, and disk storage; and if so, to judge whether performance can be improved by increasing the capacity of some part of the system.
To use this feature to examine InnoDB performance:
You must be running MySQL 5.5 or higher. You must build the database server from source, enabling the Performance Schema feature by building with the
--with-perfschemaoption. Since the Performance Schema feature introduces some performance overhead, you should use it on a test or development system rather than on a production system.You must be running InnoDB 1.1 or higher.
You must be generally familiar with how to use the Performance Schema feature, for example to query tables in the
performance_schemadatabase.Examine the following kinds of InnoDB objects by querying the appropriate
performance_schematables. The items associated with InnoDB all contain the substringinnodbin theNAMEcolumn.For the definitions of the
*_INSTANCEStables, see Section 21.7.5, “Performance Schema Instance Tables”. For the definitions of the*_SUMMARY_*tables, see Section 21.7.4, “Performance Schema Summary Tables”. For the definition of thePROCESSLISTtable, see Section 21.7.6, “Performance Schema Miscellaneous Tables”. For the definition of the*_CURRENT_*tables, see Section 21.7.2, “Performance Schema Events (Current) Table”. For the definition of the*_HISTORY_*tables, see Section 21.7.3, “Performance Schema History Tables”.Mutexes in the
mutex_instancestable. (Mutexes and RW-locks related to theInnoDBbuffer pool are not included in this coverage; the same applies to the output of theSHOW ENGINE INNODB MUTEXcommand.)RW-locks in the
rwlock_instancestable.RW-locks in the
rwlock_instancestable.File I/O operations in the
file_instances,file_summary_by_event_name, andfile_summary_by_instancetables.Threads in the
PROCESSLISTtable.
During performance testing, examine the performance data in the
events_waits_currentandevents_waits_history_longtables. If you are interested especially in InnoDB-related objects, use the clausewhere name like "%innodb%"to see just those entries; otherwise, examine the performance statistics for the overall MySQL server.You must be running MySQL 5.5, with the Performance Schema enabled by building with the
--with-perfschemabuild option.
For more information about the MySQL Performance Schema, see Chapter 21, MySQL Performance Schema.