Hi Team,
I am looking at the percona monitoring management documentation, wherein it has talked about IO analysis for queries. MySQL Query Performance Troubleshooting: Resource-Based Approach - Percona Database Performance Blog. In the document, it is mentioned that “MySQL does not really provide very good instrumentation in those terms, and it is not easy to get information on how much CPU usage, Disk IO, or Memory a given query caused.”
Since I know PMM depends on performance schema in mysql to get stats, I was wondering how we collect query level stats for IO wait metrics. Performance schema has wait related instruments, however it provides aggregated level information. It does not provide metrics for individual query level IO wait. Can you please help me understand how we prepare this data?
Thanks
Hello @soumyaukil,
PMM collects standard OS metrics by directly querying the kernel/OS. MySQL does not expose CPU/disk metrics of the overall system. This is what the documentation means when it says this is not easy to get. PMM uses two collectors: node_exporter and mysql_exporter to gather data about the system (node) and mysql (mysql).
1 Like
Hi @matthewb,
Thanks for your answer. I understand that Mysql does not expose CPU/disk metrics of the overall system. However I am confused with this diagram present in this blog MySQL Query Performance Troubleshooting: Resource-Based Approach - Percona Database Performance Blog. If you look at second screenshot at Disk IO Analysi s, it seems like we are trying to capture IO load information for individual query. I have attached the screenshot here as well. If mysql does not provide this IO metrics for each query, then how are we calculating this data for individual query? Please clarify.
1 Like
I guess I didn’t understand what you were asking about in your original post. The screenshot helps clarify. That information comes directly from the slow query log metrics which are calculated after each query execution. Take a look here: Slow Query Log
1 Like