From ea3c5ad25b19055d98e0faebc9b9ed97a165b7ea Mon Sep 17 00:00:00 2001 From: Aolin Date: Wed, 1 Feb 2023 13:55:55 +0800 Subject: [PATCH] *: always enable block cache (#12053) --- hybrid-deployment-topology.md | 8 +------- tikv-configuration-file.md | 9 ++------- tune-tikv-memory-performance.md | 3 ++- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/hybrid-deployment-topology.md b/hybrid-deployment-topology.md index cc54fba32496f..bcc3104ea2c2b 100644 --- a/hybrid-deployment-topology.md +++ b/hybrid-deployment-topology.md @@ -48,15 +48,9 @@ This section introduces the key parameters when you deploy multiple instances on ``` readpool.unified.max-thread-count = cores * 0.8 / the number of TiKV instances ``` - - - To configure the storage CF (all RocksDB column families) to be self-adaptive to memory. By configuring the `storage.block-cache.capacity` parameter, you can make CF automatically balance the memory usage. - - `storage.block-cache` enables the CF self-adaptation by default. You do not need to modify it. + - To configure the storage CF (all RocksDB column families) to be self-adaptive to memory. By configuring the `storage.block-cache.capacity` parameter, you can make CF automatically balance the memory usage. - ```yaml - storage.block-cache.shared: true - ``` - - The calculation method: ``` diff --git a/tikv-configuration-file.md b/tikv-configuration-file.md index cb9a29bac1881..5ec47696b683a 100644 --- a/tikv-configuration-file.md +++ b/tikv-configuration-file.md @@ -491,12 +491,7 @@ Configuration items related to storage. ## storage.block-cache -Configuration items related to the sharing of block cache among multiple RocksDB Column Families (CF). When these configuration items are enabled, block cache separately configured for each column family is disabled. - -### `shared` - -+ Enables or disables the sharing of block cache. -+ Default value: `true` +Configuration items related to the sharing of block cache among multiple RocksDB Column Families (CF). ### `capacity` @@ -1267,7 +1262,7 @@ Configuration items related to `rocksdb.defaultcf`, `rocksdb.writecf`, and `rock ### `block-cache-size` -+ The cache size of a RocksDB block ++ The cache size of a RocksDB block. Starting from v6.6.0, this configuration is only used to calculate the default value of `storage.block-cache.capacity`. + Default value for `defaultcf`: `Total machine memory * 25%` + Default value for `writecf`: `Total machine memory * 15%` + Default value for `lockcf`: `Total machine memory * 2%` diff --git a/tune-tikv-memory-performance.md b/tune-tikv-memory-performance.md index 3fdf8010e6a44..1e25aa75d513d 100644 --- a/tune-tikv-memory-performance.md +++ b/tune-tikv-memory-performance.md @@ -22,7 +22,7 @@ TiKV implements `Column Families` (CF) from RocksDB. - The `default` CF stores the Raft log. The corresponding parameters are in `[raftdb.defaultcf]`. -After TiKV 3.0, by default, all CFs share one block cache instance. You can configure the size of the cache by setting the `capacity` parameter under `[storage.block-cache]`. The bigger the block cache, the more hot data can be cached, and the easier to read data, in the meantime, the more system memory is occupied. To use a separate block cache instance for each CF, set `shared=false` under `[storage.block-cache]`, and configure individual block cache size for each CF. For example, you can configure the size of `write` CF by setting the `block-cache-size` parameter under `[rocksdb.writecf]`. +After TiKV 3.0, by default, all CFs share one block cache instance. You can configure the size of the cache by setting the `capacity` parameter under `[storage.block-cache]`. The bigger the block cache, the more hot data can be cached, and the easier to read data, in the meantime, the more system memory is occupied. Before TiKV 3.0, shared block cache is not supported, and you need to configure block cache for each CF individually. @@ -73,6 +73,7 @@ log-level = "info" ## ## The rest of config in the storage.block-cache session is effective only when shared block cache ## is on. +## Starting from v6.6.0, the `shared` option is always enabled and cannot be disabled. # shared = true ## Size of the shared block cache. Normally it should be tuned to 30%-50% of system's total memory.