If you use TiDB Ansible to deploy the TiDB cluster, the monitoring system is deployed at the same time. For more information, see TiDB Monitoring Framework Overview.
The Grafana dashboard is divided into a series of sub dashboards which include Overview, PD, TiDB, TiKV, Node_exporter, Disk Performance, and so on. A lot of metrics are there to help you diagnose.
For routine operations, you can get an overview of the component (PD, TiDB, TiKV) status and the entire cluster from the Overview dashboard, where the key metrics are displayed. This document provides a detailed description of these key metrics.
To understand the key metrics displayed on the Overview dashboard, check the following table:
|Services Port Status
|the online nodes number of each service
|Services Port Status
|the offline nodes number of each service
|the total storage capacity of the TiDB cluster
|Current Storage Size
|the occupied storage capacity of the TiDB cluster
|Number of Regions
|the total number of Regions of the current cluster
|Leader Balance Ratio
|the leader ratio difference of the nodes with the biggest leader ratio and the smallest leader ratio
|It is less than 5% for a balanced situation and becomes bigger when you restart a node.
|Region Balance Ratio
|the Region ratio difference of the nodes with the biggest Region ratio and the smallest Region ratio
|It is less than 5% for a balanced situation and becomes bigger when you add or remove a node.
|Store Status -- Up Stores
|the number of TiKV nodes that are up
|Store Status -- Disconnect Stores
|the number of TiKV nodes that encounter abnormal communication within a short time
|Store Status -- LowSpace Stores
|the number of TiKV nodes with an available space of less than 20%
|Store Status -- Down Stores
|the number of TiKV nodes that are down
|The normal value is
0. If the number is bigger than
0, it means some node(s) are abnormal.
|Store Status -- Offline Stores
|the number of TiKV nodes (still providing service) that are being made offline
|Store Status -- Tombstone Stores
|the number of TiKV nodes that are successfully offline
|the 99th percentile duration to complete a pd-server request
|less than 5ms
|the request duration of a PD request
|The state of each Region.
|Generally, the number of pending peers is less than 100, and that of the missing peers cannot always be greater than
|Hot write Region's leader distribution
|The total number of leaders who are the write hotspots on each TiKV instance.
|Hot read Region's leader distribution
|The total number of leaders who are the read hotspots on each TiKV instance.
|Region heartbeat report
|The count of heartbeats reported to PD per instance.
|99% Region heartbeat latency
|The heartbeat latency per TiKV instance (P99).
|the total number of executed SQL statements, including
UPDATE and so on
|the execution time of a SQL statement
|QPS By Instance
|the QPS on each TiDB instance
|Failed Query OPM
|the number of failed SQL statements, including syntax error and key conflicts and so on
|the connection number of each TiDB instance
|Heap Memory Usage
|the size of heap memory used by each TiDB instance
|the number of executed transactions per second
|the execution time of a transaction
|KV Cmd OPS
|the number of executed KV commands
|KV Cmd Duration 99
|the execution time of the KV command
|PD TSO OPS
|the number of TSO that TiDB obtains from PD
|PD TSO Wait Duration
|the time consumed when TiDB obtains TSO from PD
|TiClient Region Error OPS
|the number of Region related errors returned by TiKV
|Lock Resolve OPS
|the number of transaction related conflicts
|Load Schema Duration
|the time consumed when TiDB obtains Schema from TiKV
|KV Backoff OPS
|the number of errors returned by TiKV (such as transaction conflicts )
|the number of leaders on each TiKV node
|the number of Regions on each TiKV node
|the CPU usage ratio on each TiKV node
|the memory usage on each TiKV node
|the data amount on each TiKV node
|the data amount on different CFs in the cluster
No data points is displayed in normal conditions. If a monitoring value displays, it means the corresponding TiKV node fails to handle the messages
|server report failures
No data points is displayed in normal conditions. If
Unreachable is displayed, it means TiKV encounters a communication issue.
|scheduler pending commands
|the number of commits on queue
|Occasional value peaks are normal.
|coprocessor pending requests
|the number of requests on queue
0 or very small
|coprocessor executor count
|the number of various query operations
|coprocessor request duration
|the time consumed by TiKV queries
|raft store CPU
|the CPU usage ratio of the raftstore thread
|The default number of threads is 2 (configured by
raftstore.store-pool-size). A value of over 80% for a single thread indicates that the CPU usage ratio is very high.
|the CPU usage ratio of the TiKV query thread, related to the application; complex queries consume a great deal of CPU
|the number of CPU cores
|the total memory
|the CPU usage ratio, 100% at a maximum
|the overload within 1 minute
|the size of the available memory
|the statistics of the network traffic
|the statistics about network monitoring and TCP
|the disk usage ratio, 100% at a maximum; generally you need to consider adding a new node when the usage ratio is up to 80% ~ 90%