Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dynamic-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ The following TiKV configuration items can be modified dynamically:
| `{db-name}.{cf-name}.soft-pending-compaction-bytes-limit` | The soft limit on the pending compaction bytes |
| `{db-name}.{cf-name}.hard-pending-compaction-bytes-limit` | The hard limit on the pending compaction bytes |
| `{db-name}.{cf-name}.titan.blob-run-mode` | The mode of processing blob files |
| `{db-name}.{cf-name}.titan.min-blob-size` | The threshold at which data is stored in Titan. Data is stored in a Titan blob file when its value reaches this threshold. |
| `{db-name}.{cf-name}.titan.blob-file-compression` | The compression algorithm used by Titan blob files |
| `{db-name}.{cf-name}.titan.discardable-ratio` | The threshold of garbage data ratio in Titan data files for GC. When the ratio of useless data in a blob file exceeds the threshold, Titan GC is triggered. |
| `server.grpc-memory-pool-quota` | Limits the memory size that can be used by gRPC |
| `server.max-grpc-send-msg-len` | Sets the maximum length of a gRPC message that can be sent |
| `server.snap-io-max-bytes-per-sec` | Sets the maximum allowable disk bandwidth when processing snapshots |
Expand Down
9 changes: 8 additions & 1 deletion storage-engine/titan-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ If you observe that the Titan GC thread is in full load for a long time from **T

You can adjust [`rate-bytes-per-sec`](/tikv-configuration-file.md#rate-bytes-per-sec) to limit the I/O rate of RocksDB compaction, reducing its impact on foreground read and write performance during high traffic.

### `shared-blob-cache` (New in v8.0.0)

You can control whether to enable the shared cache for Titan blob files and RocksDB block files through [`shared-blob-cache`](/tikv-configuration-file.md#shared-blob-cache-new-in-v800). The default value is `true`. When the shared cache is enabled, block files have higher priority. This means that TiKV prioritizes meeting the cache needs of block files and then uses the remaining cache for blob files.

### Titan configuration example

The following is an example of the Titan configuration file. You can either [use TiUP to modify the configuration](/maintain-tidb-using-tiup.md#modify-the-configuration) or [configure a TiDB cluster on Kubernetes](https://docs.pingcap.com/tidb-in-kubernetes/stable/configure-a-tidb-cluster).
Expand All @@ -121,7 +125,6 @@ max-background-gc = 1
min-blob-size = "32KB"
blob-file-compression = "zstd"
zstd-dict-size = "16KB"
blob-cache-size = "0GB"
discardable-ratio = 0.5
blob-run-mode = "normal"
level-merge = false
Expand Down Expand Up @@ -154,6 +157,10 @@ To fully disable Titan for all existing and future data, you can follow these st

2. (Optional) Perform a full compaction using tikv-ctl. This process will consume a large amount of I/O and CPU resources.

> **Warning:**
>
> When disk space is insufficient, executing the following command might result in the entire cluster running out of available space and thus unable to write data.

```bash
tikv-ctl --pd <PD_ADDR> compact-cluster --bottommost force
```
Expand Down
7 changes: 6 additions & 1 deletion tikv-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -1658,9 +1658,14 @@ Configuration items related to `rocksdb.defaultcf.titan`.
+ The cache size of a Blob file
+ Default value: `"0GiB"`
+ Minimum value: `0`
+ Recommended value: After database stabilization, it is recommended to set the RocksDB block cache (`storage.block-cache.capacity`) based on monitoring to maintain a block cache hit rate of at least 95%, and set `blob-cache-size` to `(total memory size) * 50% - (size of block cache)`. This is to ensure that the block cache is sufficiently large to cache the entire RocksDB, while maximizing the blob cache size. However, to prevent a significant drop in the block cache hit rate, do not set the blob cache size too large.
+ Recommended value: `0`. Starting from v8.0.0, TiKV introduces the `shared-blob-cache` configuration item and enables it by default, so there is no need to set `blob-cache-size` separately. The configuration of `blob-cache-size` only takes effect when `shared-blob-cache` is set to `false`.
+ Unit: KiB|MiB|GiB

### `shared-blob-cache` (New in v8.0.0)

+ Controls whether to enable the shared cache for Titan blob files and RocksDB block files.
+ Default value: `true`. When the shared cache is enabled, block files have higher priority. This means that TiKV prioritizes meeting the cache needs of block files and then uses the remaining cache for blob files.

### `min-gc-batch-size`

+ The minimum total size of Blob files required to perform GC for one time
Expand Down