# Duration Related (Continue...)

+ `Grafana` Monitor TikV-Details —> Raft Wanted —> Apply wait duration


![left](./student-guide/diagram/09-TiKV-Duration-08-01.png)
------------------------------------------------------------
- Duration related
  - gRPC - 99% gRPC message duration: The total processing time of the request on the TiKV side. Potential network problems can be found by comparing the gRPC duration of TiKV with the KV Request duration in TiDB. For example, the gRPC duration is very short but the KV duration of TiDB is very long, indicating that the network latency between TiDB and TiKV may be high or the network card bandwidth may be full.

  - Scheduler - Scheduler command duration: The time it takes to execute scheduler-related commands such as prewrite/commit/get/batch_get. If it is high, you need to check the following Scheduler latch wait Duration and Raft-related write latency.

  - Scheduler - Scheduler latch wait duration: Due to the time overhead caused by latch wait, the purpose of latch is to allow request to modify the same key to be executed serially. When the same key write conflict is severe, the latch wait duration will High; also causes a high latch wait duration when scheduler writes are stacked. You can check whether the Scheduler - Scheduler writing bytes metric exceeds [storage] scheduler-pending-write The throttling threshold set by -threshold.

  - Raft IO - Append log duration: The time it takes to write the raft log to raftdb. If it is high, further troubleshoot the slow Raft RocksDB issue.

  - Raft IO - Apply log duration: The time it takes to apply the Raft log, and the time it takes to execute the raft log to write data to kvdb. If it is high, further troubleshoot the slow KV RocksDB issue.

  - Raft IO - Commit log duration: The time taken by the Raft commit log. The log is sent to other Raftstore threads via raft to process writes. If there is a hot write and the commit log duration is relatively high, you can adjust the raft- appropriately The max-inflight-msgs parameter.

  - Raft Execution - Delay between sending a request to Raftstore and actually processing the request. If the delay is high, it means that Raftstore is busy or append log comparisons take a long time, causing Raftstore to not process request in a timely manner.

  - Raft Delay - Apply wait duration: The delay between when committed raft logs are sent to the apply thread and when the apply thread actually applies these logs. If the delay is high, the apply thread is busy. You need to see if this is due to the high apply CPU or because the disk load is high.
