We have setup our database servers to log all slow queries > 2 seconds. This can be done by enabling below from your configuration file or via runtime using SET GLOBAL command.
Append to configuration (my.cnf) under [mysqld]
Using query
With this current setup, we filtered all queries from our application running more than 2 seconds. This is a good way to identify slow queries and optimise them.
However, there are also queries from the MySQL Enterprise monitor that were also being logged. In this case, i found out a (2) graph metrics checking every minute for the total backup time (total_time) and total lock time (lock_time). It takes about 3-6 seconds with only about 70 records on table.
To give you exactly the query, here it is:
This query checks every minute on the table mysql.backup_history which is a CSV table with no indexes.
In short, I like to disable these 2 graphs so I end up googling and posting to mysql forums but found no answer so I scrutinize every directory in my agent folder until finally found where the graph items are being hidden.
The graph items in MySQL Enterprise Monitor was stored in an XML file in the agent directory where I installed the MEM agent.
I edited the XML file and commented out the whole class name that triggers that Backup Run Time and Backup Locked Time graphs.
The disadvantage of disabling these metrics is that you will no longer monitor it from the Enterprise Monitor dashboard. You have to manually query it from the mysql.backup_history table to see the results of your backup.![]()
![]()
PlanetMySQL Voting: Vote UP / Vote DOWN
Append to configuration (my.cnf) under [mysqld]
slow_query_log = on
long_query_time = 2
Using query
SET GLOBAL slow_query_log = on;
SET GLOBAL long_query_time = 2
With this current setup, we filtered all queries from our application running more than 2 seconds. This is a good way to identify slow queries and optimise them.
However, there are also queries from the MySQL Enterprise monitor that were also being logged. In this case, i found out a (2) graph metrics checking every minute for the total backup time (total_time) and total lock time (lock_time). It takes about 3-6 seconds with only about 70 records on table.
To give you exactly the query, here it is:
# Time: 120420 16:27:01
# User@Host: agent_user[agent_user] @ [127.0.0.1]
# Query_time: 3.141840 Lock_time: 0.000134 Rows_sent: 1 Rows_examined: 71
SET timestamp=1334910421;
SELECT IF(end_time >= (NOW() - INTERVAL 60 SECOND), TIMESTAMPDIFF(SECOND, start_time, end_time), 0) AS total_time, IF((end_time >= (NOW() - INTERVAL 60 SECOND)), lock_time, 0) $
This query checks every minute on the table mysql.backup_history which is a CSV table with no indexes.
In short, I like to disable these 2 graphs so I end up googling and posting to mysql forums but found no answer so I scrutinize every directory in my agent folder until finally found where the graph items are being hidden.
The graph items in MySQL Enterprise Monitor was stored in an XML file in the agent directory where I installed the MEM agent.
/opt/mysql/enterprise/agent/share/mysql-monitor-agent/items/items-mysql-monitor.xml
I edited the XML file and commented out the whole class name that triggers that Backup Run Time and Backup Locked Time graphs.
The disadvantage of disabling these metrics is that you will no longer monitor it from the Enterprise Monitor dashboard. You have to manually query it from the mysql.backup_history table to see the results of your backup.
PlanetMySQL Voting: Vote UP / Vote DOWN