Skip to content

Commit

Permalink
tidb: add doc for batch-policy config (#18446)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyguan authored Aug 20, 2024
1 parent bb94d49 commit 44c5192
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tidb-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,16 @@ Configuration items related to opentracing.reporter.
- Default value: `41s`
- It is required to set this value larger than twice of the Raft election timeout.

### `batch-policy` <span class="version-mark">New in v8.3.0</span>

- Controls the batching strategy for requests from TiDB to TiKV. When sending requests to TiKV, TiDB always encapsulates the requests in the current waiting queue into a `BatchCommandsRequest` and sends it to TiKV as a packet. This is the basic batching strategy. When the TiKV load throughput is high, TiDB decides whether to wait for an additional period after the basic batching based on the value of `batch-policy`. This additional batching allows more requests to be encapsulated in a single `BatchCommandsRequest`.
- Default value: `"standard"`
- Value options:
- `"basic"`: the behavior is consistent with versions before v8.3.0, where TiDB performs additional batching only if [`tikv-client.max-batch-wait-time`](#max-batch-wait-time) is greater than 0 and the load of TiKV exceeds the value of [`tikv-client.overload-threshold`](#overload-threshold).
- `"standard"`: TiDB dynamically batches requests based on the arrival time intervals of recent requests, suitable for high-throughput scenarios.
- `"positive"`: TiDB always performs additional batching, suitable for high-throughput testing scenarios to achieve optimal performance. However, in low-load scenarios, this strategy might introduce unnecessary batching wait time, potentially reducing performance.
- `"custom{...}"`: allows customization of batching strategy parameters. This option is intended for the internal testing of TiDB and is **NOT recommended** for general use.

### `max-batch-size`

- The maximum number of RPC packets sent in batch. If the value is not `0`, the `BatchCommands` API is used to send requests to TiKV, and the RPC latency can be reduced in the case of high concurrency. It is recommended that you do not modify this value.
Expand Down

0 comments on commit 44c5192

Please sign in to comment.