TIBCO LogLogic LMI - Using MySQL profiling for troubleshooting
book
Article ID: KB0077978
calendar_today
Updated On:
Products
Versions
TIBCO LogLogic Enterprise Virtual Appliance
All
Description
When troubleshooting issues inside of LMI, it can be useful to enable MySQL profiling. This gives a number of statistics that can help to identify bottlenecks inside MySQL.
This shows that profiling is not currently enabled, so we need to turn it on. Note that in this instance we will be setting a session variable. It is possible to enable profiling globally inside my.cnf, but that is beyond the remit of this KB.
The query above enables profiling. Note that the warning that is referenced refers to the fact that profiling may be removed in a later version. Now that we have profiling enabled, we can run a query to create a profile. I've chosen the following as it is reasonably intensive, which is useful for illustration:
As you can see, we now have a breakdown of exactly where our time is being used. In this instance, it is clear that, were we thinking this query were causing problems, we should focus on the Sending data phase. In addition to this basic data, there are a number of additional sets of metrics that are captured by the profilier. These are:
• ALL - displays all information • BLOCK IO - displays counts for block input and output operations • CONTEXT SWITCHES - displays counts for voluntary and involuntary context switches • CPU - displays user and system CPU usage times • IPC - displays counts for messages sent and received • MEMORY - is not currently implemented • PAGE FAULTS - displays counts for major and minor page faults • SOURCE - displays the names of functions from the source code, together with the name and line number of the file in which the function occurs • SWAPS - displays swap counts
As an example, for our query above, we may wish to see the CPU stats and the source function inside MySQL that is associated. We would then run: