Skip to main content

MySQL metrics

Database metric comprehensively collects the database workload and resource usage. The WhaTap monitoring service continuously collects metric data to identify bottlenecks in the database and provides data to help identify the root cause of the performance issue.

IndicatorsUnitDescriptionCategory
Aborted_connects-Server connection failure countConnection
active_sessions-Query running session count. It is the same as Threads_running.Connection
Connection_errors_internal-Number of connections rejected by server errorsConnection
Connection_errors_max_connections-Number of connections rejected by the limit of max_connectionsConnection
Connections-DB connection trial countConnection
Max_used_connections-Maximum number of used connections after startupConnection
Threads_connected-Number of connected sessionsConnection
max_connections-Too ManyConnection Error may occur if the maximum number of concurrent client connections exceeds or the connection count is insufficient.Info
Bytes_received-If bytes and Bytes_received of the DB server are high, it indicates that this server is a write-oriented server (e.g. insert).MySQL Resource
Bytes_sent-If bytes and Bytes_sent from the DB server are high, it indicates that this server is a read-oriented (select) server. If you apply it together with Questions and Uptime, the average bytes per query and the processing bytes per hour can be counted.MySQL Resource
Created_tmp_disk_tables-Number of temporary tables on disk created by the server while executing commands. Because disk usage can degrade the performance, if this value increases, consider adjusting values for tmp_table_size or max_heap_table_size.MySQL Resource
Created_tmp_files-Number of temporary files created by mysqldMySQL Resource
Created_tmp_tables-Number of internal temporary tables created by the server while executing commands. Temporary tables can be used in a few cases, typically when using UNION ALL in a query or when using ORDER BY, GROUP BY, or DISTINCT. It is recommended that the number of temporary tables on disk (Created_tmp_disk_tables) is not high (less than 10%) relative to the total number of internal temporary tables (Created_tmp_disk_tables + Created_tmp_tables).MySQL Resource
Innodb_buffer_pool_bytes_dirty-Number of changed data bytes in the buffer pool (number of dirty data)MySQL Resource
Innodb_buffer_pool_pages_data-Number of pages in use in the total buffer pool.MySQL Resource
Innodb_buffer_pool_pages_dirty-Number of changed data pages in the buffer pool (number of dirty pages)MySQL Resource
Innodb_buffer_pool_pages_flushed-Number of InnoDB buffer pool pages flushed. Excessive flushing can put a strain on the disk while writing dirty data, it must be monitored along with the disk performance.MySQL Resource
Innodb_buffer_pool_pages_free-Number of unused (available) pages in the entire buffer poolMySQL Resource
Innodb_buffer_pool_pages_total-Number of pages in the entire buffer poolMySQL Resource
Innodb_buffer_pool_read_requests-Number of logical read requests (including physical reads). Inodb buffer pool hit ratio can be calculated as follows, and 90% or higher is recommended. If the hit ratio is low, consider adding Innodb_buffer_pool_size.
Buffer Hit Ratio = (1 - (Innodb_buffer_pool_reads/Innodb_buffer_pool_read_requests)) * 100
MySQL Resource
Innodb_buffer_pool_reads-The number of physical (disk) reads. The number of logical read requests that are not in the Innodb buffer pool and must be read directly from the disk.MySQL Resource
Innodb_data_reads-Number of InnoDB reads (not to be confused with InnoDB_Data_Read)MySQL Resource
Innodb_data_writes-Number of InnoDB writes.MySQL Resource
Innodb_dblwr_writes-Number of writes to the Innodb Doublewrite buffers.MySQL Resource
Innodb_log_waits-The number of times waited for the log buffer to be flushed because it was small. The redo log contention rate can be calculated as (Innodb_log_waits/Innodb_log_writes), a value less than 1 is recommended. If Wait is high, consider increasing innodb_log_buffer_size.MySQL Resource
Innodb_log_writes-Number of physical writes to the innodb redo log file.MySQL Resource
Binlog_bytes_written-Number of bytes recorded in the binary log.Performance
Binlog_commits-Number of commits recorded in the binary log.Performance
Innodb_row_lock_time-Total time spent acquiring row locks (milliseconds)Performance
Innodb_row_lock_waits-Count to wait for a row lock in the Innodb storage engine table. This is the waiting count to acquire a lock, not the number of lock acquisitions. If this metric increases more than usual, the query wait occurs (lock contention), and query tuning is required.Performance
lock_wait_sessions-Number of waits for acquiring row lock. It is the number of innodb_lock_waits (data_lock_waits).Performance
replication_delay-Delay time reflected in the replication DB for the replication structure. This is a metric measured in the slave DB.Performance
Slaves_running-Number of slave SQL threads executingPerformance
Slow_queries-Number of queries executed longer than the time set in the DB parameter, long_query_time (seconds).Performance
Sort_rows-Number of rows sortedPerformance
Com_commit-Number of commitsThroughput
Com_delete-Number of delete commands executed. It counts the number of rows deleted from the table and the row that are different from handler_delete.Throughput
Com_insert-Number of inserted commands that have been executedThroughput
Com_rollback-Rollback countThroughput
Com_select-Number of executed Select commandsThroughput
Com_update-Number of executed update commandsThroughput
Innodb_rows_read-Number of processed rows by SelectThroughput
Innodb_rows_writes-Number of rows processed by Write. It is the same as Innodb_rows_inserted + Innodb_rows_updated + Innodb_rows_deleted.Throughput
Queries-Number of statements executed by the server, excluding com_ping and com_statistics. It differs from Questions because it also counts the statements executed in the stored program.Throughput
Questions-Number of queries executedThroughput
Select_full_join-Number of full scans for driven tables without using indexes when joining more than one table.Throughput
Select_scan-Number of full scans for the driving table. In this case, ALL appears in the type column of the plan.Throughput
Writes-Number of commands used by Write. It is the same as Com_insert + Com_update + Com_delete.Throughput
cpu(xos2)pctCPU utilization, cpu_user + cpu_sys + cpu_iowait.XOS
cpu_user(xos2)pctTime spent for CPU to execute user codeXOS
cpu_sys(xos2)pctTime spent for CPU to execute the kernel codeXOS
cpu_iowait(xos2)pctCPU time waited for IOXOS
cpu_idle(xos2)pctCPU processor's idle timeXOS
mem(xos)pctMemory utilizationXOS
mem_total(xos)MBTotal amount of memoryXOS
mem_free(xos)MBAmount of memory not in use by the systemXOS
mem_used(xos)MBAmount of memory in use by the systemXOS
mem_buffcache(xos)MBAmount of memory used by the buff/cacheXOS
mem_swaptotal(xos)MBSet this in preparation for the case where the total Swap size and physical memory are insufficient.XOS
mem_swapfree(xos)MBBecause the unused Swap area and Swap area are secured in disk space, the system performance may drop drastically while using Swap.XOS
mem_available(xos)MBAvailable memory areaXOS
disk_reads(xos)blockAmount of data read from diskXOS
disk_read_bytes(xos)byteAmount of data read from diskXOS
disk_writes(xos)blockAmount of data written to diskXOS
disk_write_bytes(xos)byteAmount of data written to diskXOS
net_recv_bytes(xos)byteAmount of data received over the networkXOS
net_recv_packets(xos)-Number of data packets received over the networkXOS
net_send_bytes(xos)byteAmount of data transmitted over the networkXOS
net_send_packets(xos)-Number of data packets transmitted over the networkXOS