eG Monitoring
 

Measures reported by MySQLSlowLgTest

In general, as applications scale in size, queries to the database server that were once extremely fast can become quite slow. When you are debugging a MySQL database server instance for performance issues, the slow query log comes in handy to figure out which queries are the slowest and how often they are slow.

A query is deemed to be slow and is logged in the slow query log if that query exceeds a given threshold of execution time. By default, all queries taking longer than 10 seconds are logged. If the queries are repeatedly logged in the slow query log, then, the size of the log may grow rapidly leading to an impact on the performance of the database server instance. To improve the performance of the database server instance, it is necessary for the administrators to identify the slow queries and optimize them at the earliest. The MySQLSlowLgTest test helps administrators to proactively track such abnormalities in the slow query log and optimize the queries before end users start complaining.

This test periodically monitors the slow query log of the target database server and reports whether/not the slow query log is enabled. This test also reports the total file size of the slow query log and the growth rate of the log file. Using this test, administrators can quickly determine abnormal growth patterns of the slow query log and identify those slow queries that are candidates for optimization.

Outputs of the test: One set of results for the target database server instance being monitored

The measures made by this test are as follows:

Measurement Description Measurement Unit Interpretation
Is_logging_enabled Indicates whether/not the slow query log is enabled. Number The values reported by this measure and its numeric equivalents are mentioned in the table below:

Measure Value Numeric Value
Yes 1
No 0
Note:

By default, this measure reports the Measure Values listed in the table above to indicate whether/not the general query log is enabled. The graph of this measure however, is represented using the numeric equivalents only i.e., 0 or 1.

File_size Indicates the current size of the slow query log. MB  
Growth_rate Indicates the rate at which the slow query log file had grown during the last measurement period. MB/sec A high value for this measure or a consistent increase in its value indicates that the slow query log is rapidly growing and may end up occupying too much space on the disk.
Slow_queries Indicates the number of queries that have been executing for more time than the value configured against the SLOW QUERY TIME parameter. Number The detailed diagnosis for this measure indicates the exact queries and which user is executing the queries. This information can be very useful in identifying queries that may be candidates for optimization.