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, see Titan: A RocksDB Plugin to Reduce Write Amplification.
How to enable Titan
To enable Titan in TiKV, set the following in the TiKV configuration file:
[rocksdb.titan] # Enables or disables `Titan`. Note that Titan is still an experimental feature. # default: false enabled = true
For the information of all the Titan configuration parameters, see Titan-related parameters.
How to fall back to RocksDB
If you find Titan does not help or causes 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"When using this command, make sure you have already enabled Titan.
Wait until the number of blob files reduces to 0. You can also accelerate it by
rocksdb.titan.enabled=falsein the TiKV configuration file, and then restart TiKV.