diff --git a/configure-store-limit.md b/configure-store-limit.md index 601094d724e67..67c80420bc740 100644 --- a/configure-store-limit.md +++ b/configure-store-limit.md @@ -6,7 +6,7 @@ aliases: ['/docs/dev/configure-store-limit/'] # Store Limit -Store Limit is a feature of PD, introduced in TiDB 3.0. It is designed to control the scheduling speed in a finer manner for better performance in different scenarios. +Store Limit is a feature of PD. It is designed to control the scheduling speed in a finer manner for better performance in different scenarios. ## Implementation principles @@ -28,44 +28,40 @@ Every time an operator is generated, it checks whether enough tokens exist in th Store Limit is different from other limit-related parameters in PD (such as `region-schedule-limit` and `leader-schedule-limit`) in that it mainly limits the consuming speed of operators, while other parameters limits the generating speed of operators. Before introducing the Store Limit feature, the speed limit of scheduling is mostly at the global scope. Therefore, even if the global speed is limited, it is still possible that the scheduling operations are concentrated on some stores, affecting the performance of the cluster. By limiting the speed at a finer level, Store Limit can better control the scheduling behavior. +Store Limit defines the maximum number of operations per minute. With a Store Limit of 5 operations per minute, adding a new node to the cluster will process 5 Regions per minute (`add-peer` operations). If 15 Regions require an `add-peer`, the operation will take 3 minutes (15 / 5 = 3) and consume up to 8 MiB/s ((5 × 96) / 60 = 8), assuming each Region is 96 MiB. + ## Usage -The parameters of Store Limit can be configured using `pd-ctl`. +The parameters of Store Limit can be configured using [`PD Control`](/pd-control.md). ### View setting of the current store To view the limit setting of the current store, run the following commands: -{{< copyable "shell-regular" >}} - ```bash -store limit // Shows the speed limit of adding and deleting peers in all stores. -store limit add-peer // Shows the speed limit of adding peers in all stores. -store limit remove-peer // Shows the speed limit of deleting peers in all stores. +tiup ctl:v pd store limit // Shows the speed limit of adding and deleting peers in all stores. +tiup ctl:v pd store limit add-peer // Shows the speed limit of adding peers in all stores. +tiup ctl:v pd store limit remove-peer // Shows the speed limit of deleting peers in all stores. ``` ### Set limit for all stores To set the speed limit for all stores, run the following commands: -{{< copyable "shell-regular" >}} - ```bash -store limit all 5 // All stores can at most add and delete 5 peers per minute. -store limit all 5 add-peer // All stores can at most add 5 peers per minute. -store limit all 5 remove-peer // All stores can at most delete 5 peers per minute. +tiup ctl:v pd store limit all 5 // All stores can at most add and delete 5 peers per minute. +tiup ctl:v pd store limit all 5 add-peer // All stores can at most add 5 peers per minute. +tiup ctl:v pd store limit all 5 remove-peer // All stores can at most delete 5 peers per minute. ``` ### Set limit for a single store To set the speed limit for a single store, run the following commands: -{{< copyable "shell-regular" >}} - ```bash -store limit 1 5 // store 1 can at most add and delete 5 peers per minute. -store limit 1 5 add-peer // store 1 can at most add 5 peers per minute. -store limit 1 5 remove-peer // store 1 can at most delete 5 peers per minute. +tiup ctl:v pd store limit 1 5 // store 1 can at most add and delete 5 peers per minute. +tiup ctl:v pd store limit 1 5 add-peer // store 1 can at most add 5 peers per minute. +tiup ctl:v pd store limit 1 5 remove-peer // store 1 can at most delete 5 peers per minute. ``` ### Principles of store limit v2