MySQL monitoring with Netdata

What is MySQL?

MySQL is an open source relational database management system (RDBMS) developed by Oracle Corporation. MySQL is the most popular database system in the world, used by many web-based applications including WordPress, Drupal, and Joomla. It is also used to power many of the world’s largest websites, including Facebook, Twitter and YouTube.

Monitoring MySQL with Netdata

The prerequisites for monitoring MySQL with Netdata are to have MySQL and Netdata installed on your system.

Netdata auto discovers hundreds of services, and for those it doesn’t turning on manual discovery is a one line configuration. For more information on configuring Netdata for MySQL monitoring please read the collector documentation.

You should now see the MySQL section on the Overview tab in Netdata Cloud already populated with charts about all the metrics you care about.

Netdata has a public demo space (no login required) where you can explore different monitoring use-cases and get a feel for Netdata.

What MySQL metrics are important to monitor - and why?

Net

Net can be used to monitor the amount of data being received and sent over the network by MySQL. It is important to keep track of this metric as it can be an indication of performance issues, such as slow queries or a large number of connections.

Queries

Queries is a metric that measures the total number of queries per second executed by MySQL. Monitoring this metric can help identify any potential performance issues, such as long running queries which may be causing slowdowns in other areas of the application.

Queries Type

Queries Type is a metric that measures the total number of queries per second executed by MySQL, separated by type. This can help identify any abnormal usage of certain query types, such as an excessive number of DELETE queries that could be causing performance issues.

Handlers

Handlers is a metric that measures the number of handlers that MySQL needs to execute a query. It is important to keep track of this metric as it can indicate that the server is overloaded with requests or is executing slow queries.

Table Open Cache Overflows

Table Open Cache Overflows is a metric that measures the number of times that the table open cache was overflowed. This metric is important to monitor as it can indicate that the number of open tables exceeds the allocated cache size which can cause performance issues.

Table Locks

Table Locks is a metric that measures the number of times a table was locked. This metric is important to monitor in order to identify potential deadlocks or excessive locking which can lead to performance issues.

Join Issues

Join Issues is a metric that measures the number of join issues that MySQL processes. This metric is important to monitor as it can indicate that the server is having trouble executing joins which can cause performance issues.

Sort Issues

Sort Issues is a metric that measures the number of sort issues that MySQL processes. This metric can be used to identify any potential issues with sorting which can cause performance issues.

Tmp

Tmp is a metric that measures the number of temporary files, tables, and events that are created by MySQL. This metric is important to monitor as it can indicate that the server is having trouble managing temporary files which can cause performance issues.

Connections

Connections is a metric that measures the number of connections to the MySQL server. This metric is important to monitor as it can indicate that the server is having trouble handling a high number of concurrent connections which can cause performance issues.

Connections Active

Connections Active is a metric that measures the number of active connections to the MySQL server. This metric is important to monitor as it can indicate that the server is having trouble handling a large number of active connections which can cause performance issues.

Threads

Threads is a metric that measures the number of threads that are connected, cached, and running on the MySQL server. This metric is important to monitor as it can indicate that the server is having trouble handling a large number of threads which can cause performance issues.

Threads Created

Threads Created is a metric that measures the number of threads created per second. This metric is important to monitor as it can indicate that the server is having trouble creating threads quickly enough which can cause performance issues.

Thread Cache Misses

Thread Cache Misses is a metric that measures the number of times a thread was not found in the thread cache. This metric is important to monitor as it can indicate that the thread cache is not large enough to handle the current workload which can cause performance issues.

Innodb IO

The rate at which InnoDB performs I/O operations. It tracks the number of KiB read or written per second. Monitoring this metric can help detect I/O bottlenecks and ensure that the database is running at optimal performance.

Innodb IO Ops

The number of I/O operations performed by InnoDB per second. This includes reads, writes and fsyncs. Monitoring this metric can help identify potential issues related to disk I/O performance.

Innodb IO Pending Ops

The number of pending I/O operations that are waiting to be completed by InnoDB. This includes reads, writes and fsyncs. Monitoring this metric can help detect problems related to disk I/O latency.

Innodb Log Train

The number of log writes and waits that occur when InnoDB is committing transactions to the log file. Monitoring this metric can help identify potential issues that can cause log write performance degradation.

Innodb Cur Row Lock

The number of current row locks that are held by InnoDB. Monitoring this metric can help identify potential locking issues that could be causing performance degradation.

Innodb Rows

The number of rows that are inserted, read, updated, or deleted by InnoDB. Monitoring this metric can help detect any issues related to the amount of data being processed by the database.

Innodb Buffer Pool Pages

The number of pages that are in the InnoDB buffer pool, including data, dirty, free, misc, and total. Monitoring this metric can help identify potential memory issues that can lead to performance slowdowns.

Innodb Buffer Pool Pages Flushed

The number of page flushes that are requested by InnoDB. Monitoring this metric can help detect any issues related to disk I/O performance.

Innodb Buffer Pool Bytes

The size of the InnoDB buffer pool, including data and dirty bytes. Monitoring this metric can help identify potential memory issues that can lead to performance slowdowns.

Innodb Buffer Pool Read Ahead

The number of pages that are read ahead by InnoDB, including all and evicted pages. Monitoring this metric can help identify potential issues with disk I/O performance.

Innodb Buffer Pool Read Ahead Rnd

The number of random read-ahead operations that are issued by InnoDB. Monitoring this metric can help identify potential disk I/O issues.

Innodb Buffer Pool Ops

The number of disk read and wait-free operations that are issued by InnoDB. Monitoring this metric can help identify potential disk I/O issues.

Innodb OS Log

The number of fsyncs and writes that are issued by InnoDB. Monitoring this metric can help identify potential issues related to log write performance.

Innodb OS Log Fsync Writes

The number of fsync writes that are issued by InnoDB. Monitoring this metric can help identify potential issues with log write performance.

Innodb OS Log IO

The amount of write I/O that is performed by InnoDB. Monitoring this metric can help identify potential disk I/O issues.

Innodb Deadlocks

The number of deadlocks that occur when InnoDB is committing transactions. Monitoring this metric can help identify any potential issues related to locking that can cause performance degradation.

Files

Files is a global metric that provides insight on the total number of files MySQL is managing. This includes log files, temporary files, and data files. Monitoring this metric can help identify any potential issues with server resources, performance, or storage capacity. Additionally, it can be used to detect any unusual activity or changes in the number of files MySQL is managing.

Files_Rate

Files_Rate is a global metric that shows the rate of files being accessed by MySQL. This metric is useful for tracking the performance of the server, as well as any potential bottlenecks or issues that may arise. Monitoring this metric in conjunction with Files can help to identify any potential issues and take corrective action as needed.

Connection_Errors

Connection_Errors is a global metric that provides insight on the number of errors encountered when establishing a connection to MySQL. This metric can be used to identify any potential issues with the connection, such as incorrect authentication credentials or incorrect server configuration. Monitoring this metric closely can help to prevent any issues that may arise from incorrect configuration.

Opened_Tables

Opened_Tables is a global metric that indicates the number of tables that have been opened by MySQL. This metric can be used to track the performance of the server, as well as to identify any potential issues with the table structure. Monitoring this metric closely can help to ensure that the tables are correctly configured and functioning correctly.

Open_Tables

Open_Tables is a global metric that provides insight on the number of tables currently opened by MySQL. This metric can be used to track the performance of the server, as well as to identify any potential issues with the table structure. Monitoring this metric closely can help to ensure that the tables are correctly configured and functioning correctly.

Process_List_Fetch_Query_Duration

Process_List_Fetch_Query_Duration is a global metric that indicates the amount of time it takes for MySQL to fetch a query from the process list. This metric can be used to identify any potential issues with the query, such as slow execution times or incorrect data being returned. Monitoring this metric closely can help to ensure that queries are executing correctly and returning the correct data.

Process_List_Queries_Count

Process_List_Queries_Count is a global metric that provides insight on the number of queries currently in the process list. This metric can be used to track the performance of the server, as well as to identify any potential issues with the query structure. Monitoring this metric closely can help to ensure that queries are being executed correctly and returning the correct data.

Process_List_Longest_Query_Duration

Process_List_Longest_Query_Duration is a global metric that provides insight on the duration of the longest query in the process list. This metric can be used to identify any potential issues with the query, such as slow execution times or incorrect data being returned. Monitoring this metric closely can help to ensure that queries are executing correctly and returning the correct data.

QCache_Ops

QCache_Ops is a global metric that provides insight on the number of queries being cached by MySQL. This metric can be used to track the performance of the server, as well as to identify any potential issues with the caching mechanism. Monitoring this metric closely can help to ensure that queries are being cached correctly and efficiently.

QCache

QCache is a global metric that provides insight on the total number of queries currently in the query cache. This metric can be used to track the performance of the server, as well as to identify any potential issues with the caching mechanism. Monitoring this metric closely can help to ensure that queries are being cached correctly and efficiently.

QCache_Freemem

QCache_Freemem is a global metric that indicates the amount of free memory available for caching queries. This metric can be used to track the performance of the server, as well as to identify any potential issues with the caching mechanism. Monitoring this metric closely can help to ensure that queries are being cached correctly and efficiently.

QCache_Memblocks

QCache_Memblocks is a global metric that provides insight on the amount of memory blocks currently in the query cache. This metric can be used to track the performance of the server, as well as to identify any potential issues with the caching mechanism. Monitoring this metric closely can help to ensure that queries are being cached correctly and efficiently.

Galera Write Sets

This metric is the rate at which data is written to and from a Galera cluster. It is a measure of the amount of data being transmitted between nodes, and should be monitored for possible issues in replication and performance. An increase in writesets indicates the system is handling more data, and can be used to identify potential bottlenecks. Monitoring this metric can help to identify problems such as slow replication, or a lack of resources, and can help to prevent outages.

Galera Bytes

This metric is the rate at which data is being transferred between nodes in a Galera cluster. It is a measure of the amount of data being transmitted between nodes, and should be monitored for possible issues in replication and performance. An increase in bytes transferred indicates the system is handling more data, and can be used to identify potential bottlenecks. Monitoring this metric can help to identify problems such as slow replication, or a lack of resources, and can help to prevent outages.

Galera Queue

This metric is the amount of data in the replication queue between nodes in a Galera cluster. It is a measure of the amount of data that is waiting to be written or read by any node in the cluster, and should be monitored for possible issues in replication and performance. An increase in the queue size indicates the system is handling more data, and can be used to identify potential bottlenecks. Monitoring this metric can help to identify problems such as slow replication, or a lack of resources, and can help to prevent outages.

Galera Conflicts

This metric is the number of conflicts that arise in a Galera cluster. It is a measure of the amount of data being written to the same row on different nodes in the cluster, and should be monitored for possible issues in replication and performance. An increase in conflicts indicates the system is having difficulty replicating data, and can be used to identify potential bottlenecks. Monitoring this metric can help to identify problems such as slow replication, or a lack of resources, and can help to prevent outages.

Galera Flow Control

This metric is the amount of time a node in a Galera cluster is paused due to flow control. It is a measure of the amount of time a node is prevented from writing to or reading from the cluster, and should be monitored for possible issues in replication and performance. An increase in flow control time indicates the system is having difficulty replicating data, and can be used to identify potential bottlenecks. Monitoring this metric can help to identify problems such as slow replication, or a lack of resources, and can help to prevent outages.

Galera Cluster Status

This metric is the status of each node in a Galera cluster. It is a measure of the current state of each node in the cluster, and should be monitored for possible issues in replication and performance. Monitoring this metric can help to identify problems such as slow replication, or a lack of resources, and can help to prevent outages.

Galera Cluster State

This metric is the overall state of the Galera cluster. It is a measure of the current state of the entire cluster, and should be monitored for possible issues in replication and performance. Monitoring this metric can help to identify problems such as slow replication, or a lack of resources, and can help to prevent outages.

Galera Cluster Size

This metric is the number of nodes in a Galera cluster. It is a measure of the amount of nodes in the cluster, and should be monitored for possible issues in replication and performance. Monitoring this metric can help to identify problems such as slow replication, or a lack of resources, and can help to prevent outages.

Galera Cluster Weight

This metric is the weight assigned to each node in a Galera cluster. It is a measure of the amount of data each node is responsible for replicating, and should be monitored for possible issues in replication and performance. Monitoring this metric can help to identify problems such as slow replication, or a lack of resources, and can help to prevent outages.

Galera Connected

This metric is a boolean value indicating whether a node in a Galera cluster is connected or not. It is a measure of the connection status of each node, and should be monitored for possible issues in replication and performance. Monitoring this metric can help to identify problems such as slow replication, or a lack of resources, and can help to prevent outages.

Galera Ready

This metric is a boolean value indicating whether a node in a Galera cluster is ready or not. It is a measure of the readiness of each node, and should be monitored for possible issues in replication and performance. Monitoring this metric can help to identify problems such as slow replication, or a lack of resources, and can help to prevent outages.

Galera Open Transactions

This metric is the number of transactions currently open in a Galera cluster. It is a measure of the amount of data that is currently being processed by the cluster, and should be monitored for possible issues in replication and performance. Monitoring this metric can help to identify problems such as slow replication, or a lack of resources, and can help to prevent outages.

Galera Thread Count

This metric is the number of threads currently running on each node in a Galera cluster. It is a measure of the amount of resources each node is using, and should be monitored for possible issues in replication and performance. Monitoring this metric can help to identify problems such as slow replication, or a lack of resources, and can help to prevent outages.

Key Blocks

This metric is the number of blocks used by a MySQL server for storing index data. It is a measure of the amount of resources the server is using to store index data, and should be monitored for possible issues in performance. Monitoring this metric can help to identify problems such as slow queries, or a lack of resources, and can help to prevent outages.

Key Requests

This metric is the rate at which data is being read and written from a MySQL server’s indexes. It is a measure of the amount of data being read and written from the indexes, and should be monitored for possible issues in performance. An increase in requests indicates the system is handling more data, and can be used to identify potential bottlenecks. Monitoring this metric can help to identify problems such as slow queries, or a lack of resources, and can help to prevent outages.

Key Disk Ops

This metric is the rate at which data is being read and written from the disk by the MySQL server. It is a measure of the amount of data being read and written from the disk, and should be monitored for possible issues in performance. An increase in disk operations indicates the system is handling more data, and can be used to identify potential bottlenecks. Monitoring this metric can help to identify problems such as slow queries, or a lack of resources, and can help to prevent outages.

Binlog Cache

This metric is the rate at which data is being written to the binary log cache for a MySQL server. It is a measure of the amount of data being written to the cache, and should be monitored for possible issues in performance. An increase in cache usage indicates the system is handling more data, and can be used to identify potential bottlenecks. Monitoring this metric can help to identify problems such as slow queries, or a lack of resources, and can help to prevent outages.

Binlog Statement Cache

This metric is the rate at which data is being written to the binary log statement cache for a MySQL server. It is a measure of the amount of data being written to the cache, and should be monitored for possible issues in performance. An increase in statement cache usage indicates the system is handling more data, and can be used to identify potential bottlenecks. Monitoring this metric can help to identify problems such as slow queries, or a lack of resources, and can help to prevent outages.

Slave Behind

This metric tracks how far behind the slave is from the master, in seconds. Monitor this metric to ensure that the slave is always up to date with the master and that replication is running smoothly. If the slave is behind by too much, it could lead to data loss or other issues if the master fails.

Slave Status

This metric tracks whether the slave SQL thread and IO thread are running. Monitor this metric to ensure that replication is running properly, as a stopped slave thread can lead to data loss or other issues.

Userstats CPU

This metric tracks how much CPU a specific user is using. It is important to monitor this metric in order to identify which users are using the most resources, and to ensure that the system is not being overworked.

Userstats Rows

This metric tracks the number of rows read, sent, updated, inserted, and deleted by a specific user. Monitor this metric to ensure that users are not making unnecessary changes to the database, and to identify any potential performance issues.

Userstats Commands

This metric tracks the number of select, update, and other commands that a user is executing. Monitor this metric to ensure that users are not executing unnecessary commands, and to identify any potential performance issues.

Userstats Denied Commands

This metric tracks the number of denied commands sent by a specific user. Monitor this metric to ensure that users are not able to execute commands they do not have permission to execute, and to identify any potential security issues.

Userstats Created Transactions

This metric tracks the number of commit and rollback transactions created by a specific user. Monitor this metric to ensure that users are not creating unnecessary transactions, and to identify any potential performance issues.

Userstats Binlog Written

This metric tracks the number of bytes written to the binary log by a specific user. Monitor this metric to ensure that users are not overloading the binary log, and to identify any potential performance issues.

Userstats Empty Queries

This metric tracks the number of empty queries sent by a specific user. Monitor this metric to ensure that users are not executing unnecessary queries, and to identify any potential performance issues.

Userstats Connections

This metric tracks the number of connections created by a specific user. Monitor this metric to ensure that users are not overloading the system with too many connections, and to identify any potential performance issues.

Userstats Lost Connections

This metric tracks the number of connections lost by a specific user. Monitor this metric to ensure that users are not losing their connections too often, and to identify any potential performance issues.

Userstats Denied Connections

This metric tracks the number of connections denied by a specific user. Monitor this metric to ensure that users are not being denied access to the system, and to identify any potential security issues.

Get Netdata

Sign up for free

Want to see a demonstration of Netdata for multiple use cases?

Go to Live Demo