Skip to content
12 changes: 10 additions & 2 deletions tikv-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ This document only describes the parameters that are not included in command-lin
### `grpc-concurrency`

+ The number of gRPC worker threads. When you modify the size of the gRPC thread pool, refer to [Performance tuning for TiKV thread pools](/tune-tikv-thread-performance.md#performance-tuning-for-tikv-thread-pools).
+ Default value: `5`
+ Default value:

+ Starting from v8.5.4 and v9.0.0, the default value is adjusted to `grpc-raft-conn-num * 3 + 2`, which is calculated based on the value of [`grpc-raft-conn-num`](#grpc-raft-conn-num). For example, when the number of CPU cores is 8, the default value of `grpc-raft-conn-num` is 1. Accordingly, the default value of `grpc-concurrency` is `1 * 3 + 2 = 5`.
+ In v8.5.3 and earlier versions, the default value is `5`.

+ Minimum value: `1`

### `grpc-concurrent-stream`
Expand All @@ -169,7 +173,11 @@ This document only describes the parameters that are not included in command-lin
### `grpc-raft-conn-num`

+ The maximum number of connections between TiKV nodes for Raft communication
+ Default value: `1`
+ Default value:

+ Starting from v8.5.4 and v9.0.0, the default value is adjusted to `MAX(1, MIN(4, CPU cores / 8))`, where `MIN(4, CPU cores / 8)` indicates that when the number of CPU cores is greater than or equal to 32, the default maximum number of connections is 4.
+ In v8.5.3 and earlier versions, the default value is `1`.

+ Minimum value: `1`

### `max-grpc-send-msg-len`
Expand Down
2 changes: 1 addition & 1 deletion tune-tikv-thread-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Starting from TiKV v5.0, all read requests use the unified thread pool for queri

* The gRPC thread pool.

The default size (configured by `server.grpc-concurrency`) of the gRPC thread pool is `5`. This thread pool has almost no computing overhead and is mainly responsible for network I/O and deserialization requests, so generally you do not need to adjust the default configuration.
Starting from v8.5.4 and v9.0.0, the default size of the gRPC thread pool (configured by `server.grpc-concurrency`) is changed from a fixed value of `5` to an adaptive value calculated based on the number of CPU cores. For the detailed calculation formula, see [`server.grpc-concurrency`](/tikv-configuration-file.md#grpc-concurrency). This thread pool has almost no computing overhead and is mainly responsible for network I/O and deserialization requests, so generally you do not need to adjust the default configuration.

- If the machine deployed with TiKV has a small number (less than or equal to 8) of CPU cores, consider setting the `server.grpc-concurrency` configuration item to `2`.
- If the machine deployed with TiKV has very high configuration, TiKV undertakes a large number of read and write requests, and the value of `gRPC poll CPU` that monitors Thread CPU on Grafana exceeds 80% of `server.grpc-concurrency`, then consider increasing the value of `server.grpc-concurrency` to keep the thread pool usage rate below 80% (that is, the metric on Grafana is lower than `80% * server.grpc-concurrency`).
Expand Down