Skip to content

Commit 321ec40

Browse files
authored
sys var: consider global sort for tidb_ddl_reorg_max_write_speed (#21643) (#21669)
1 parent ed8ff7f commit 321ec40

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

system-variables.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1719,12 +1719,19 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1;
17191719
- Type: String
17201720
- Default value: `0`
17211721
- Range: `[0, 1PiB]`
1722-
- This variable limits the write bandwidth for each TiKV node and only takes effect when index creation acceleration is enabled (controlled by the [`tidb_ddl_enable_fast_reorg`](#tidb_ddl_enable_fast_reorg-new-in-v630) variable). When the data size in your cluster is quite large (such as billions of rows), limiting the write bandwidth for index creation can effectively reduce the impact on application workloads.
1722+
- This variable limits the write bandwidth from **a single TiDB node to a single TiKV node** during index backfilling. It only takes effect when index creation acceleration is enabled (controlled by the [`tidb_ddl_enable_fast_reorg`](#tidb_ddl_enable_fast_reorg-new-in-v630) variable). Note that when [Global Sort](/tidb-global-sort.md) is enabled, multiple TiDB nodes can write to TiKV concurrently. When the data size in your cluster is quite large (such as billions of rows), limiting the write bandwidth for index creation can effectively reduce the impact on application workloads.
17231723
- The default value `0` means no write bandwidth limit.
17241724
- You can specify the value of this variable either with a unit or without a unit.
17251725
- When you specify the value without a unit, the default unit is bytes per second. For example, `67108864` represents `64MiB` per second.
17261726
- When you specify the value with a unit, supported units include KiB, MiB, GiB, and TiB. For example, `'1GiB`' represents 1 GiB per second, and `'256MiB'` represents 256 MiB per second.
17271727
1728+
Example:
1729+
1730+
Assume that you have a cluster with 4 TiDB nodes and multiple TiKV nodes. In this cluster, each TiDB node can perform index backfilling, and Regions are evenly distributed across all TiKV nodes. If you set `tidb_ddl_reorg_max_write_speed` to `100MiB`:
1731+
1732+
- When Global Sort is disabled, only one TiDB node writes to TiKV at a time. In this case, the maximum write bandwidth per TiKV node is `100MiB`.
1733+
- When Global Sort is enabled, all 4 TiDB nodes can write to TiKV simultaneously. In this case, the maximum write bandwidth per TiKV node is `4 * 100MiB = 400MiB`.
1734+
17281735
### tidb_ddl_reorg_worker_cnt
17291736
17301737
> **Note:**

0 commit comments

Comments
 (0)