# Handling Write Stall

+ Two `RocksDB` instances are used in `TiKV` as the storage of `Raft` log and `KV` data
+ When the number of `memtable` or level 0 is too large, `RocksDB` will slow down the writes
+ Above behavior is the so called **_write stall_**


![`smart`](./student-guide/diagram/TiKVHandlingWriteStall_aa_001_20221014.png)
------------------------------------------------------------
Since two RocksDB are used in TiKV as the storage of raft log and KV data, when the number of memtalbe or level 0 is too large, RocksDB will slow down writes to achieve the purpose of self-protection. This action is called write stall.

We can monitor the occurrence and cause of Write Stall via TikV-Details -> RocksDB KV/RocksDB raft -> Write Stall Reason or RocksDB logs (look for the Stalling keyword).
