Skip to content
2 changes: 1 addition & 1 deletion best-practices/massive-regions-best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@

### Method 7: Increase the maximum number of connections for Raft communication

By default, the maximum number of connections used for Raft communication between TiKV nodes is 1. Increasing this number can help alleviate blockage issues caused by heavy communication workloads of a large number of Regions. For detailed instructions, see [`grpc-raft-conn-num`](/tikv-configuration-file.md#grpc-raft-conn-num).
To adjust the maximum number of connections used for Raft communication between TiKV nodes, you can modify the [`server.grpc-raft-conn-num`](/tikv-configuration-file.md#grpc-raft-conn-num) configuration item. Increasing this number can help alleviate blockage issues caused by heavy communication workloads of a large number of Regions.

Check warning on line 153 in best-practices/massive-regions-best-practices.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [PingCAP.Ambiguous] Consider using a clearer word than 'a large number of' because it may cause confusion. Raw Output: {"message": "[PingCAP.Ambiguous] Consider using a clearer word than 'a large number of' because it may cause confusion.", "location": {"path": "best-practices/massive-regions-best-practices.md", "range": {"start": {"line": 153, "column": 311}}}, "severity": "INFO"}

> **Note:**
>
Expand Down
2 changes: 1 addition & 1 deletion best-practices/three-nodes-hybrid-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The default value of this parameter is 80% of the number of machine threads. In

#### `server.grpc-concurrency`

This parameter defaults to `4`. Because in the existing deployment plan, the CPU resources are limited and the actual requests are few. You can observe the monitoring panel, lower the value of this parameter, and keep the usage rate below 80%.
Because in the existing deployment plan, the CPU resources are limited and the actual requests are few. You can observe the monitoring panel, lower the value of [`server.grpc-concurrency`](/tikv-configuration-file.md#grpc-concurrency), and keep the usage rate below 80%.

In this test, the value of this parameter is set to `2`. Observe the **gRPC poll CPU** panel and you can see that the usage rate is just around 80%.

Expand Down
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-memory-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ log-level = "info"
# Size of thread pool for gRPC
# grpc-concurrency = 4
# The number of gRPC connections between each TiKV instance
# grpc-raft-conn-num = 10
# grpc-raft-conn-num = 1

# Most read requests from TiDB are sent to the coprocessor of TiKV. This parameter is used to set the number of threads
# of the coprocessor. If many read requests exist, add the number of threads and keep the number within that of the
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