Skip to main content

MySQL metrics

Database metrics comprehensively collect 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.

For more information about other metrics, see the following.

agent_status_summary

This category collects metrics related to agent status every 10 seconds.

Fields

FieldTypeUnitDescription
inActTime-Millisecond(ms)Amount of time the agent remains inactive
isActiveBoolean-Whether the agent is active or not
isRestartBoolean-Whether the agent was restarted recently (true / false)
lastActTime-Millisecond(ms)Last time when the agent was activated (0: Disabled)
oid--Unique IDs for each agent in the project
startTime-Millisecond(ms)Timestamp when the agent was started.

db_mysql_counter

Tags

The following lists the tags that are collected in the db_mysql_counter category.

TagsDescriptionAdditional Info
agentIpIP address per agent-
dbIsMultiMultitenant Supportable or not-
dbNameDatabase name-
dbTypeDatabase Type-
dbVersionVersion of the database in use-
onameAgent nameUnique value

Field

The following lists the fields that are collected in the db_mysql_counter category.

MetricCategory / UnitDescription
aborted_clientsConnectionNumber of clients that were abnormally terminated
access_denied_errorsConnectionNumber of login failures
- It increases when a wrong username/password is used.
Active sessionsConnectionQuery running session count
- same as Threads_running
active_transactionsThroughputActive transaction count
bytes_receivedThroughput / ByteNumber of bytes received from the client
- A high value indicates the server that is heavily focused on write operations.
bytes_sentThroughput / ByteTotal bytes transmitted to the client
- A high value indicates the server that is heavily focused on read operations
- It is useful when analyzed together with Questions and Uptime
com_commitThroughputNumber of executions of the COMMIT command
com_deleteThroughputNumber of executions of the DELETE command
com_insertThroughputNumber of executions of the INSERT command
com_rollbackThroughputNumber of executions of the ROLLBACK command
com_selectThroughputNumber of executions of the SELECT command
com_updateThroughputNumber of executions of the UPDATE command
connectionsConnectionNumber of client attempts to connect to the MySQL server
created_tmp_disk_tablesPerformanceNumber of temporary tables created on disk
- It occurs due to insufficient memory when joining/sorting/grouping
- Consider adjusting the tmp_table_size and max_heap_table_size
created_tmp_filesPerformanceNumber of created temporary files
created_tmp_tablesPerformanceInternal temporary table created by the server
- Used in UNION ALL, ORDER BY, and GROUP BY
- Disk temporary table ratio is recommended to be less than 10%
innodb_buffer_pool_pages_freeInnoDBNumber of unused (available) pages in the entire buffer pool
innodb_buffer_pool_pages_totalInnoDBNumber of pages in the entire buffer pool
innodb_buffer_pool_read_requestsInnoDBNumber of pages for read operations from the buffer pool
- Buffer Hit Ratio = (1 - (innodb_buffer_pool_reads / innodb_buffer_pool_read_requests)) * 100
- 90% or more is recommended. Otherwise, consider increasing the innodb_buffer_pool_size.
innodb_buffer_pool_readsInnoDBNumber of pages read from disk
- A high value indicates a low buffer pool hit ratio.
innodb_buffer_pool_wait_freeInnoDBNumber of waits for disk flush because there were no free pages in the buffer pool
innodb_log_waitsInnoDBNumber of waits for disk write operations because the log buffer was full
- Redo log contention ratio = innodb_log_waits / innodb_log_writes
- Less than 1 is recommended. If the value is higher, consider increasing the innodb_log_buffer_size.
innodb_rows_deletedInnoDBNumber of rows deleted from the InnoDB table
innodb_rows_insertedInnoDBNumber of rows inserted in the InnoDB table
innodb_rows_readInnoDBNumber of rows processed in SELECT
innodb_rows_updatedInnoDBNumber of rows updated in the InnoDB table
innodb_rows_writesInnoDBNumber of rows processed for write operations
- innodb_rows_inserted + innodb_rows_updated + innodb_rows_deleted
innodb_row_lock_timeInnoDB / msTotal time spent acquiring row locks (milliseconds)
innodb_row_lock_waitsInnoDBNumber of waits for row locks
- If the value increases rapidly, query tuning is required.
lock_wait_sessionsPerformanceNumber of sessions waiting for row locks
- It is the same as innodb_row_lock_current_waits.
max_connectionsConnectionMaximum number of simultaneous client connections
- The Too Many Connection error may occur when the number of connections is insufficient.
queriesThroughputTotal number of executed SQL statements
- It includes the statements executed in the stored programs.
questionsThroughputNumber of statements executed by the MySQL server
- It excludes the statements executed in the stored programs.
replication_delayPerformance/secReplication delay time (secs)
- It is measured in the slave DB.
select_full_joinPerformanceNumber of full joins occurred without using indexes
- If the value is higher, consider reviewing the missing indexes.
select_scanPerformanceNumber of full table scans without using indexes
- Check the type = ALL query in the execution plan.
slow_queriesPerformanceNumber of queries that took longer than the long_query_time
- If the value increases rapidly, check the slow query log.
sort_merge_passesPerformanceNumber of sort merge passes
- If the value is higher, consider improving query indexing or increasing the sort_buffer_size.
table_locks_waitedPerformanceNumber of waits for the table because another lock was already using it
- Lock wait ratio = table_locks_waited / (table_locks_immediate + table_locks_waited) * 100
- If the value is higher, consider optimizing the query and partitioning/replicating the table.
table_open_cache_missesPerformanceNumber of table opens with no cache
threads_connectedConnectionNumber of connected clients
- If it increases rapidly, it is recommended to check for connection leaks.
threads_runningThroughputNumber of running threads
- if it is consistently high, it may be a bottleneck.
trx_rseg_history_lenPerformanceUndo record storage space's usage
- If it increases continuously, performance degradation may occur.
uptimePerformanceElapsed time (seconds) since start of the MySQL server

XOS-related metrics

The following describes the metrics collected from the XOS agent.

MetricUnitDescription
cpu(xos)pctCPU utilization
cpu_user + cpu_sys + cpu_iowait
cpu_idle(xos)pctCPU idle time
cpu_iowait(xos)pctCPU's I/O waiting time
cpu_sys(xos)pctCPU's kernel code execution time
cpu_user(xos)pctCPU's user code execution time
disk_read_bytes(xos)byteNumber of data blocks read from disk
disk_reads(xos)blockNumber of buffers read from disk
disk_write_bytes(xos)byteNumber of pages written to disk
disk_writes(xos)blockNumber of buffers written to disk
mem(xos)pctMemory utilization
mem_available(xos)MBShared memory size
mem_buffcache(xos)MBAmount of memory used by the buff/cache
mem_free(xos)MBMemory not in use
mem_swapfree(xos)MBUnused swap space size
Because swap uses disk space, it may cause performance degradation.
mem_swaptotal(xos)MBTotal swap size
It is used when physical memory is insufficient.
mem_total(xos)MBTotal memory size
mem_used(xos)MBMemory size in use
net_recv_bytes(xos)byteAmount of data transmitted over the network
net_recv_packets(xos)countNumber of data packets transmitted over the network
net_send_bytes(xos)byteAmount of data transmitted over the network
net_send_packets(xos)countNumber of data packets transmitted over the network