Skip to content
Open
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
65 changes: 64 additions & 1 deletion tikv-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ TiKV 配置文件比命令行参数支持更多的选项。你可以在 [etc/con
+ 默认值:60s
+ 最小值:1s

### end-point-memory-quota <span class="version-mark">从 v8.2.0 版本开始引入</span>

* TiKV Coproccessor 请求可以使用的内存上限,超过该值后后续的 Coprocessor 请求将被拒绝并报错(server is busy)。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description of end-point-memory-quota is unclear and lacks context. It should explicitly mention that this configuration controls the memory usage limit for Coprocessor requests and what happens when the limit is exceeded. Additionally, the error message should be clarified.

Suggested change
* TiKV Coproccessor 请求可以使用的内存上限,超过该值后后续的 Coprocessor 请求将被拒绝并报错(server is busy
* TiKV Coprocessor 请求可以使用的内存上限。当内存使用超过该限制时,后续的 Coprocessor 请求将被拒绝,并返回错误信息 `server is busy`

* 默认值:系统总内存大小的 45%(如果超过 500MB,则默认值为 500MB)。

### `snap-io-max-bytes-per-sec`

+ 处理 snapshot 时最大允许使用的磁盘带宽。
Expand Down Expand Up @@ -503,6 +508,11 @@ TiKV 配置文件比命令行参数支持更多的选项。你可以在 [etc/con
> - 由于 API V1 和 API V2 底层存储格式不同,因此**仅当** TiKV 中只有 TiDB 数据时,可以平滑启用或关闭 API V2。其他情况下,需要新建集群,并使用 [TiKV Backup & Restore](https://tikv.org/docs/latest/concepts/explore-tikv-features/backup-restore-cn/) 工具进行数据迁移。
> - 启用 API V2 后,**不能**将 TiKV 集群回退到 v6.1.0 之前的版本,否则可能导致数据损坏。

## txn-status-cache-capacity <span class="version-mark">从 v7.6.0 版本开始引入</span>

+ 设置 TiKV 内的事务状态 cache 的容量。不建议用户随意修改。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description for txn-status-cache-capacity is too vague and does not provide enough context for users to understand its purpose or implications. It should clarify what the cache is used for and why modifying it is not recommended.

Suggested change
+ 设置 TiKV 内的事务状态 cache 的容量。不建议用户随意修改。
+ 设置 TiKV 内的事务状态缓存(Transaction Status Cache)的容量。该缓存用于存储事务状态信息,以提高事务处理的性能。不建议用户随意修改,因为不合理的配置可能导致性能下降或内存使用过高

+ 默认值:5120000

## storage.block-cache

RocksDB 多个 CF 之间共享 block cache 的配置选项。
Expand Down Expand Up @@ -1049,6 +1059,41 @@ raftstore 相关的配置项。
+ 控制 TiKV 执行周期性全量数据整理时的 CPU 使用率阈值。
+ 默认值:`0.1`,表示全量数据整理进程的最大 CPU 使用率为 10%。

### follower-read-max-log-gap <span class="version-mark">从 v7.4.0 版本开始引入</span>

+ follower 处理读请求时允许的最大日志落后数目,超出则拒绝读请求。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description of follower-read-max-log-gap is unclear. It should explicitly mention that this parameter is related to Raft logs and specify the unit of the value (e.g., number of logs).

Suggested change
+ follower 处理读请求时允许的最大日志落后数目,超出则拒绝读请求。
+ follower 处理读请求时允许的最大 Raft 日志落后数目(以日志条数为单位),超出则拒绝读请求。

+ 默认值:100

### inspect-cpu-util-thd <span class="version-mark">从 v7.6.0 版本开始引入</span>

+ TiKV 进行慢节点检测时判定节点 CPU 是否处于繁忙状态的阈值。范围 [0%, 100%]。
+ 默认值:40%

### inspect-kvdb-interval <span class="version-mark">从 v8.1.2 版本开始引入</span>

+ TiKV 进行慢节点检测时检查 KV 盘的间隔和超时时间。如果 KVDB 和 RaftDB 使用相同的挂载路径,该值将被覆盖为 0(不检测)。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description of inspect-kvdb-interval is ambiguous. It should clarify what happens when KVDB and RaftDB use the same mount path and why the value is overridden to 0.

Suggested change
+ TiKV 进行慢节点检测时检查 KV 盘的间隔和超时时间。如果 KVDB 和 RaftDB 使用相同的挂载路径,该值将被覆盖为 0(不检测)。
+ TiKV 进行慢节点检测时检查 KV 盘的间隔和超时时间。如果 KVDB 和 RaftDB 使用相同的挂载路径,该值将被覆盖为 0(不检测),以避免重复检测

+ 默认值:2s

### min-pending-apply-region-count <span class="version-mark">从 v8.0.0 版本开始引入</span>

+ TiKV 启动服务时,处于忙于应用 Raft 日志状态的 Region 的最大个数。只有当忙于应用 Raft 日志的 Region 数量低于该值时,Raftstore 才能接受 leader 迁移,以减少滚动重启期间的可用性下降。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description of min-pending-apply-region-count is confusing. It should clarify that this parameter is used during TiKV startup and its purpose is to ensure availability during rolling restarts.

Suggested change
+ TiKV 启动服务时,处于忙于应用 Raft 日志状态的 Region 的最大个数。只有当忙于应用 Raft 日志的 Region 数量低于该值时,Raftstore 才能接受 leader 迁移,以减少滚动重启期间的可用性下降。
+ TiKV 启动服务时,处于忙于应用 Raft 日志状态的 Region 的最大个数。只有当忙于应用 Raft 日志的 Region 数量低于该值时,Raftstore 才能接受 leader 迁移,以减少滚动重启期间的可用性下降。

+ 默认值:10

### request-voter-replicated-index-interval <span class="version-mark">从 v6.6.0 版本开始引入</span>

+ 控制 Witness 节点定期从投票节点获取已复制的 Raft 日志位置的时间间隔。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description of request-voter-replicated-index-interval is unclear. It should specify the purpose of this parameter and how it affects Witness nodes.

Suggested change
+ 控制 Witness 节点定期从投票节点获取已复制的 Raft 日志位置的时间间隔。
+ 控制 Witness 节点定期从投票节点获取已复制的 Raft 日志位置的时间间隔,以确保 Witness 节点的数据同步状态

+ 默认值:5分钟

### slow-trend-unsensitive-cause <span class="version-mark">从 v6.6.0 版本开始引入</span>

+ TiKV 采用 SlowTrend 检测算法时,延时检测的敏感性。值越高表示敏感度越低。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description of slow-trend-unsensitive-cause is unclear. It should explain what the value represents and how it affects the detection algorithm.

Suggested change
+ TiKV 采用 SlowTrend 检测算法时,延时检测的敏感性。值越高表示敏感度越低。
+ TiKV 采用 SlowTrend 检测算法时,延时检测的敏感性。值越高表示敏感度越低,即对延时变化的反应越迟钝

+ 默认值:10

### slow-trend-unsensitive-result <span class="version-mark">从 v6.6.0 版本开始引入</span>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in the parameter name slow-trend-unsensitive-result. It should be slow-trend-insensitive-result.

Suggested change
### slow-trend-unsensitive-result <span class="version-mark">从 v6.6.0 版本开始引入</span>
+ ### slow-trend-insensitive-result <span class="version-mark">从 v6.6.0 版本开始引入</span>


+ TiKV 采用 SlowStrend 检测算法时,QPS 侧检测的敏感性。值越高表示敏感度越低。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description of slow-trend-unsensitive-result is unclear. It should explain what the value represents and how it affects the detection algorithm.

Suggested change
+ TiKV 采用 SlowStrend 检测算法时,QPS 侧检测的敏感性。值越高表示敏感度越低。
+ TiKV 采用 SlowTrend 检测算法时,QPS 侧检测的敏感性。值越高表示敏感度越低,即对 QPS 变化的反应越迟钝

+ 默认值:0.5

## coprocessor

Coprocessor 相关的配置项。
Expand Down Expand Up @@ -1349,6 +1394,11 @@ RocksDB 相关的配置项。
+ `true`:在 MANIFEST 文件中记录 WAL 文件的信息,并在启动时验证 WAL 文件的完整性。
+ `false`:不在 MANIFEST 文件中记录 WAL 文件的信息,而且不在启动时验证 WAL 文件的完整性。

### enable-multi-batch-write <span class="version-mark">从 v6.2.0 版本开始引入</span>

+ 开启 RocksDB 写入优化,将 WriteBatch 中的内容并发写入到 memtable 中,缩短写入耗时。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description of enable-multi-batch-write could be more precise. It should clarify that the optimization is specifically for concurrent writes to the memtable, which reduces write latency.

Suggested change
+ 开启 RocksDB 写入优化,将 WriteBatch 中的内容并发写入到 memtable 中,缩短写入耗时
+ 开启 RocksDB 写入优化,将 WriteBatch 中的内容并发写入到 memtable 中,从而减少写入延迟

+ 默认值:无,但在默认情况下会自动开启,除非手动设置成 false 或者开启 `rocksdb.enable-pipelined-write` 或 `rocksdb.enable-unordered-write`。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description of the default value for enable-multi-batch-write is unclear and could lead to confusion. It should explicitly state the conditions under which the feature is enabled or disabled by default.

Suggested change
+ 默认值:无,但在默认情况下会自动开启,除非手动设置成 false 或者开启 `rocksdb.enable-pipelined-write``rocksdb.enable-unordered-write`
+ 默认值:无,但在默认情况下会自动开启,除非手动设置成 `false` 或者同时开启了 `rocksdb.enable-pipelined-write``rocksdb.enable-unordered-write`


## rocksdb.titan

Titan 相关的配置项。
Expand Down Expand Up @@ -1380,7 +1430,7 @@ Titan 相关的配置项。
+ 默认值:4
+ 最小值:1

## rocksdb.defaultcf | rocksdb.writecf | rocksdb.lockcf
## rocksdb.defaultcf | rocksdb.writecf | rocksdb.lockcf | rocksdb.raftcf

rocksdb defaultcf、rocksdb writecf 和 rocksdb lockcf 相关的配置项。

Expand Down Expand Up @@ -1646,6 +1696,11 @@ rocksdb defaultcf、rocksdb writecf 和 rocksdb lockcf 相关的配置项。
+ 默认值:无,表示默认不触发此 compaction。
+ 单位:s(second)|h(hour)|d(day)

### `max-compactions` <span class="version-mark">从 v6.6.0 版本开始引入</span>

+ 最大 compaction 任务并发数。0 表示不限制。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description of max-compactions is unclear. It should specify whether this configuration applies to all compaction tasks or specific types of compaction tasks (e.g., manual or automatic). Additionally, it should mention the potential impact on system performance when setting this value.

Suggested change
+ 最大 compaction 任务并发数。0 表示不限制。
+ 最大 compaction 任务并发数。0 表示不限制。该配置适用于所有 compaction 任务。设置过高的值可能会增加系统负载,影响性能。

+ 默认值:0

## rocksdb.defaultcf.titan

> **注意:**
Expand Down Expand Up @@ -2028,6 +2083,12 @@ Raft Engine 相关的配置项。
+ 控制 Raft Engine 是否自动生成空的日志文件用于日志回收。该配置项启用时,Raft Engine 将在初始化时自动填充一批空日志文件用于日志回收,保证日志回收在初始化后立即生效。
+ 默认值:`false`

### `compression-level` <span class="version-mark">从 v7.4.0 版本开始引入</span>

+ 设置 raft-engine 在写 raft log 文件时所采用的 lz4 压缩算法的压缩效率,范围 [1, 16],越低压缩速率越高,但压缩率越低。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description of compression-level is unclear and could be misleading. The phrase '越低压缩速率越高,但压缩率越低' is ambiguous. It should clearly state the trade-off between compression speed and compression ratio.

Suggested change
+ 设置 raft-engine 在写 raft log 文件时所采用的 lz4 压缩算法的压缩效率,范围 [1, 16],越低压缩速率越高,但压缩率越低
+ 设置 raft-engine 在写 raft log 文件时所采用的 lz4 压缩算法的压缩效率,范围 [1, 16]。值越低,压缩速度越快,但压缩后的文件大小越大;值越高,压缩速度越慢,但压缩后的文件大小越小


+ 默认值:1

## security

安全相关配置项。
Expand Down Expand Up @@ -2517,6 +2578,8 @@ TiKV MVCC 内存引擎 (In-Memory Engine) 在 TiKV 存储层相关的配置项

+ 是否开启内存引擎以加速多版本查询。关于内存引擎的详细信息,参见 [TiKV MVCC 内存引擎](/tikv-in-memory-engine.md)。
+ 默认值:false(即关闭内存引擎)
+ 建议 TiKV 节点至少配置 8 GiB 内存,推荐配置 32 GiB 或更多内存以获得更佳性能。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentence about memory configuration is unclear and lacks context. It should specify whether the memory requirement is per TiKV node or for the entire cluster. Additionally, it should clarify if this is a minimum requirement or a recommendation for optimal performance.

Suggested change
+ 建议 TiKV 节点至少配置 8 GiB 内存,推荐配置 32 GiB 或更多内存以获得更佳性能。
+ 建议每个 TiKV 节点至少配置 8 GiB 内存,推荐配置 32 GiB 或更多内存以获得更佳性能。

+ 如果 TiKV 可用内存过低,即使将该配置项设置为 `true`,内存引擎也不会被启用。此时,你可以在 TiKV 的日志文件中查找与 `"in-memory engine is disabled because"` 相关的日志信息,以判断为何内存引擎未能启用。
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentence about low memory conditions could be more precise. It should explicitly state that the memory engine will not be enabled if the available memory is below a certain threshold, and it should specify what that threshold is.

Suggested change
+ 如果 TiKV 可用内存过低,即使将该配置项设置为 `true`,内存引擎也不会被启用。此时,你可以在 TiKV 的日志文件中查找与 `"in-memory engine is disabled because"` 相关的日志信息,以判断为何内存引擎未能启用。
+ 如果 TiKV 节点的可用内存低于 8 GiB,即使将该配置项设置为 `true`,内存引擎也不会被启用。此时,你可以在 TiKV 的日志文件中查找与 `"in-memory engine is disabled because"` 相关的日志信息,以判断为何内存引擎未能启用。


### `capacity` <span class="version-mark">从 v8.5.0 版本开始引入</span>

Expand Down