RocksDB Titan Config
Learn how to enable Titan in TiKV.
Titan is a RocksDB plugin developed by PingCAP to separate keys and values in RocksDB storage. The goal of Titan is to reduce the write amplification when storing large values.
How Titan works
Titan store values separately from the LSM-tree during flush and compaction. The value in the LSM tree is the position index to the blob file of the real value. For more details on the design and implementation of Titan, please refer to Titan: A RocksDB Plugin to Reduce Write Amplification.
How to enable Titan
To enable Titan in TiKV, set in the TiKV configuration file:
[rocksdb.titan] # Enables or disables `Titan`. Note that Titan is still an experimental feature. # default: false enabled = true
You can find all the Titan configuration options here.
How to fall back to RocksDB
If you find Titan does not help or is causing read or other performance issues, you can take the following steps to fall back to RocksDB:
Enter the fallback mode using
tikv-ctl --host 127.0.0.1:20160 modify-tikv-config -m kvdb -n default.blob_run_mode -v "kFallback"Make sure you have already enabled Titan when using this command.
Wait until the number of blob files reduces to 0. Also, you can accelerate it by
In the TiKV configuration file, set
rocksdb.titan.enabled=false, and then restart TiKV.