Sign InTry Free

TiDB Cloud Built-in Monitoring

TiDB Cloud collects and displays a full set of standard metrics of your cluster on the Monitoring page. By viewing these metrics, you can easily identify performance issues and determine whether your current database deployment meets your requirements.

View the Monitoring page

To view the metrics on the Monitoring page, take the following steps:

  1. Navigate to the Diagnosis tab of a cluster.

  2. Click the Monitoring tab.

Monitoring metrics

The following sections illustrate the metrics on the Monitoring page.

Database Time

Metric nameLabelsDescription
Database Time by SQL typesdatabase time, {SQL type}database time: total database time per second.
{SQL type}: database time consumed by SQL statements per second, which are collected by SQL types, such as SELECT, INSERT, and UPDATE.
Database Time by SQL Phasedatabase time, get token, parse, compile, executeDatabase time consumed in four SQL processing phases: get token, parse, compile, and execute. The SQL execution phase is in green and other phases are in red on general. If non-green areas take a large proportion, it means most database time is consumed by other phases than the execution phase and further cause analysis is required.
SQL Execute Time Overviewtso_wait, Get, Cop, Commit, etc.Green metrics stand for common KV write requests (such as prewrite and commit), blue metrics stand for common read requests, and metrics in other colors stand for unexpected situations which you need to pay attention to. For example, pessimistic lock KV requests are marked red and TSO waiting is marked dark brown. If non-blue or non-green areas take a large proportion, it means there is a bottleneck during SQL execution. For example, if serious lock conflicts occur, the red area will take a large proportion. If excessive time is consumed in waiting TSO, the dark brown area will take a large proportion.

Application Connection

Metric nameLabelsDescription
Connection CountTotal, active connectionTotal: the number of connections to all TiDB instances.
Active connections: the number of active connections to all TiDB instances.
DisconnectionInstancesThe number of clients disconnected to each TiDB instance.

SQL Count

Metric nameLabelsDescription
Query Per Second{SQL type}The number of SQL statements executed per second in all TiDB instances, which are collected by SQL types, such as SELECT, INSERT, and UPDATE.
Failed QueriesError typesThe statistics of error types (such as syntax errors and primary key conflicts) according to the SQL statement execution errors per minute on each TiDB instance. It contains the module in which an error occurs and the error code.
Command Per SecondQuery, StmtExecute, StmtPrepare, etc.The number of commands processed by all TiDB instances per second based on command types.
Queries Using Plan Cache OPShit, misshit: the number of queries using plan cache per second in all TiDB instances.
miss: the number of queries missing plan cache per second in all TiDB instances.

Latency Break Down

Metric nameLabelsDescription
Query Durationavg-{SQL Types}, 99-{SQL Types}The duration from receiving a request from the client to TiDB till TiDB executing the request and returning the result to the client. In general, client requests are sent in the form of SQL statements; however, this duration can include the execution time of commands such as COM_PING, COM_SLEEP, COM_STMT_FETCH, and COM_SEND_LONG_DATA. TiDB supports Multi-Query, which means the client can send multiple SQL statements at one time, such as select 1; select 1; select 1;. In this case, the total execution time of this query includes the execution time of all SQL statements.
Average Idle Connection Durationavg-in-txn, avg-not-in-txnThe connection idle duration indicates the duration of a connection being idle.
avg-in-txn: The average connection idle duration when a connection is within a transaction.
avg-not-in-txn: The average connection idle duration when a connection is not within a transaction.
Get Token Durationavg, 99The average time or P99 duration consumed in getting tokens of SQL statements.
Parse Durationavg, 99The average time or P99 duration consumed in parsing SQL statements.
Compile Durationavg, 99The average time or P99 duration consumed in compiling the parsed SQL AST to execution plans.
Execute Durationavg, 99The average time or P99 duration consumed in executing execution plans of SQL statements.

Transaction

Metric nameLabelsDescription
Transaction Per Second{types}-{transaction model}The number of transactions executed per second.
Transaction Durationavg-{transaction model}, 99-{transaction model}The execution duration of a transaction.

Core Path Duration

Metric nameLabelsDescription
Avg TiDB KV Request DurationGet, Prewirite, Commit, PessimisticLock, etc.The average time consumed in executing KV requests in all TiDB instances based on request types, including Get, Prewrite, and Commit.
Avg TiKV GRPC Durationkv_get, kv_prewirite, kv_commit, kv_pessimisticLock, etc.The average time consumed in executing gRPC requests in all TiKV instances based request types, including kv_get, kv_prewrite, and kv_commit.
Average / P99 PD TSO Wait/RPC Durationwait-avg/99, rpc-avg/99Wait: the average time or P99 duration in waiting for PD to return TSO in all TiDB instances.
RPC: the average time or P99 duration from sending TSO requests to PD to receiving TSO in all TiDB instances.
Average / P99 Storage Async Write Durationavg, 99The average time or P99 duration consumed in asynchronous writing. Average storage async write duration = Average store duration + Average apply duration.
Average / P99 Store Durationavg, 99The average time or P99 duration consumed in storing loop during asynchronously writing.
Average / P99 Apply Durationavg, 99The average time or P99 duration consumed in applying loop during asynchronously writing.
Average / P99 Append Log Durationavg, 99The average time or P99 duration consumed by Raft to append logs.
Average / P99 Commit Log Durationavg, 99The average time or P99 duration consumed by Raft to commit logs.
Average / P99 Apply Log Durationavg, 99The average time or P99 duration consumed by Raft to apply logs.

Server

Metric nameLabelsDescription
TiDB UptimeinstancesThe runtime of each TiDB instance since last restart.
TiDB CPU UsageinstancesThe statistics of CPU usage of each TiDB instance.
TiDB Memory UsageinstancesThe memory usage statistics of each TiDB instance.
TiKV UptimeinstancesThe runtime of each TiKV instance since last restart.
TiKV CPU UsageinstancesThe statistics of CPU usage of each TiKV instance.
TiKV Memory UsageinstancesThe memory usage statistics of each TiKV instance.
TiKV IO MBpsinstances-write, instances-readThe total bytes of read and write in each TiKV instance.
TiKV Storage UsageinstancesThe storage size per TiKV instance.
TiFlash UptimeinstancesThe runtime of each TiFlash instance since last restart.
TiFlash CPU UsageinstancesThe statistics of CPU usage of each TiFlash instance.
TiFlash MemoryinstancesThe memory usage statistics of each TiFlash instance.
TiFlash IO MBpsinstances-write, instances-readThe total bytes of read and write in each TiFlash instance.
TiFlash Storage UsageinstancesThe storage size per TiFlash instance.

FAQ

1. Why are some panes empty on this page?

If a pane does not provide any metrics, the possible reasons are as follows:

  • The workload of the corresponding cluster does not trigger this metric. For example, the failed query metric is always empty in the case of no failed queries.
  • The cluster version is low. You need to upgrade it to the latest version of TiDB to see these metrics.

If all these reasons are excluded, you can contact the PingCAP support team for troubleshooting.

Download PDFRequest docs changes
Was this page helpful?
Open Source Ecosystem
TiDB
TiKV
TiSpark
Chaos Mesh
© 2022 PingCAP. All Rights Reserved.