From 5322100d29e274daa64fafc56c188371b40cc4a0 Mon Sep 17 00:00:00 2001 From: en-jin19 Date: Mon, 28 Mar 2022 22:46:17 +0800 Subject: [PATCH 1/7] TiKV config: Add quota-related configurations --- tikv-configuration-file.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tikv-configuration-file.md b/tikv-configuration-file.md index 914601f205c7d..a6999b56a4f28 100644 --- a/tikv-configuration-file.md +++ b/tikv-configuration-file.md @@ -1543,3 +1543,35 @@ For pessimistic transaction usage, refer to [TiDB Pessimistic Transaction Mode]( + Enables the in-memory pessimistic lock feature. With this feature enabled, pessimistic transactions try to store their locks in memory, instead of writing the locks to disk or replicating the locks to other replicas. This improves the performance of pessimistic transactions. However, there is a still low probability that the pessimistic lock gets lost and causes the pessimistic transaction commits to fail. + Default value: `true` + Note that `in-memory` takes effect only when the value of `pipelined` is `true`. + +## quota + +Configuration items related to Quota Limiter. + +Suppose that your machine deployed TiKV has limited resources, for example, 4v CPU, 16 G memory. In this case, if TiKV foreground processes requests in too large volumes, the foreground occupies the CPU resources for processing background requests, which causes performance degradation. To avoid this issue, you can use the quota-related configuration items to limit the CPU resources used by the foreground. When requests trigger the Quota Limiter feature, the requests are forced to wait for a while to free up CPU resources. The exact waiting time depends on the volume of the requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-durationnew-in-v600). + +> **Warning:** +> +> - Quota Limiter is an experimental feature introduced TiDB v6.0.0, and it is **NOT** recommended to use it in the production environment. +> - This feature is only suitable for environments with limited resources, which ensures that TiKV can run continuously in these environments. If you enable this feature on an environment with rich resources, when the volume of requests reach a peak, performance degradation might be caused. + +### `foreground-cpu-time`(new in v6.0.0) + ++ The soft limit on controlling the CPU resources used by TiKV foreground to process read and write requests. ++ Default value: `0` (no limit) ++ Unit: millicpu (`1500` means that foreground requests consume 1.5v CPU) + +### `foreground-write-bandwidth`(new in v6.0.0) + ++ The soft limit for transactions to write data. ++ Default value: `0KB`(no limit) + +### `foreground-read-bandwidth`(new in v6.0.0) + ++ The soft limit for transactions and Coprocessor to read data. ++ Default value: `0KB` (no limit) + +### `max-delay-duration`(new in v6.0.0) + ++ The maximum time that a single read and write request of the foreground is forced to wait. ++ Default value: `500ms` \ No newline at end of file From f058740fa10b170a6aca9f499f8e62e74847df32 Mon Sep 17 00:00:00 2001 From: en-jin19 Date: Tue, 29 Mar 2022 16:31:03 +0800 Subject: [PATCH 2/7] Update descriptions --- tikv-configuration-file.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tikv-configuration-file.md b/tikv-configuration-file.md index a6999b56a4f28..73fad80c57319 100644 --- a/tikv-configuration-file.md +++ b/tikv-configuration-file.md @@ -1548,12 +1548,12 @@ For pessimistic transaction usage, refer to [TiDB Pessimistic Transaction Mode]( Configuration items related to Quota Limiter. -Suppose that your machine deployed TiKV has limited resources, for example, 4v CPU, 16 G memory. In this case, if TiKV foreground processes requests in too large volumes, the foreground occupies the CPU resources for processing background requests, which causes performance degradation. To avoid this issue, you can use the quota-related configuration items to limit the CPU resources used by the foreground. When requests trigger the Quota Limiter feature, the requests are forced to wait for a while to free up CPU resources. The exact waiting time depends on the volume of the requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-durationnew-in-v600). +Suppose that your machine deployed TiKV has limited resources, for example, 4v CPU, 16 G memory. In this case, if the amount of requests processed by TiKV in the foreground is too large, the CPU resources for background processing are occupied by the foreground, causing TiKV performance to degrade. To avoid this issue, you can use the quota-related configuration items to limit the CPU resources used by the foreground. When requests trigger the Quota Limiter feature, the requests are forced to wait for a while to free up CPU resources. The exact waiting time depends on the amount of the requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-durationnew-in-v600). > **Warning:** > > - Quota Limiter is an experimental feature introduced TiDB v6.0.0, and it is **NOT** recommended to use it in the production environment. -> - This feature is only suitable for environments with limited resources, which ensures that TiKV can run continuously in these environments. If you enable this feature on an environment with rich resources, when the volume of requests reach a peak, performance degradation might be caused. +> - This feature is only suitable for environments with limited resources, which ensures that TiKV can run stably in those environments for the long term. If you enable this feature in an environment with rich resources, performance degradation might be caused when the amount of requests reaches a peak. ### `foreground-cpu-time`(new in v6.0.0) @@ -1564,7 +1564,7 @@ Suppose that your machine deployed TiKV has limited resources, for example, 4v C ### `foreground-write-bandwidth`(new in v6.0.0) + The soft limit for transactions to write data. -+ Default value: `0KB`(no limit) ++ Default value: `0KB` (no limit) ### `foreground-read-bandwidth`(new in v6.0.0) @@ -1573,5 +1573,5 @@ Suppose that your machine deployed TiKV has limited resources, for example, 4v C ### `max-delay-duration`(new in v6.0.0) -+ The maximum time that a single read and write request of the foreground is forced to wait. ++ The maximum time that a single read and write request needed to be processed in the foreground is forced to wait. + Default value: `500ms` \ No newline at end of file From d0e394ca09e36ba5df739e74de979a77fd62ba57 Mon Sep 17 00:00:00 2001 From: Enwei Date: Tue, 29 Mar 2022 20:29:55 +0800 Subject: [PATCH 3/7] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- tikv-configuration-file.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tikv-configuration-file.md b/tikv-configuration-file.md index 73fad80c57319..1fa236611d7d1 100644 --- a/tikv-configuration-file.md +++ b/tikv-configuration-file.md @@ -1552,26 +1552,26 @@ Suppose that your machine deployed TiKV has limited resources, for example, 4v C > **Warning:** > -> - Quota Limiter is an experimental feature introduced TiDB v6.0.0, and it is **NOT** recommended to use it in the production environment. -> - This feature is only suitable for environments with limited resources, which ensures that TiKV can run stably in those environments for the long term. If you enable this feature in an environment with rich resources, performance degradation might be caused when the amount of requests reaches a peak. +> - Quota Limiter is an experimental feature introduced in TiDB v6.0.0, and it is **NOT** recommended to use it in the production environment. +> - This feature is only suitable for environments with limited resources to ensure that TiKV can run stably in those environments. If you enable this feature in an environment with rich resources, performance degradation might occur when the amount of requests reaches a peak. -### `foreground-cpu-time`(new in v6.0.0) +### `foreground-cpu-time` (new in v6.0.0) + The soft limit on controlling the CPU resources used by TiKV foreground to process read and write requests. -+ Default value: `0` (no limit) -+ Unit: millicpu (`1500` means that foreground requests consume 1.5v CPU) ++ Default value: `0` (which means no limit) ++ Unit: millicpu (for example, `1500` means that foreground requests consume 1.5v CPU) -### `foreground-write-bandwidth`(new in v6.0.0) +### `foreground-write-bandwidth` (new in v6.0.0) + The soft limit for transactions to write data. -+ Default value: `0KB` (no limit) ++ Default value: `0KB` (which means no limit) -### `foreground-read-bandwidth`(new in v6.0.0) +### `foreground-read-bandwidth` (new in v6.0.0) + The soft limit for transactions and Coprocessor to read data. -+ Default value: `0KB` (no limit) ++ Default value: `0KB` (which means no limit) -### `max-delay-duration`(new in v6.0.0) +### `max-delay-duration` (new in v6.0.0) -+ The maximum time that a single read and write request needed to be processed in the foreground is forced to wait. ++ The maximum time that a single read or write request is forced to wait before it is processed in the foreground. + Default value: `500ms` \ No newline at end of file From a04410dd706fba22f303324ee38ffb6b4f13d22b Mon Sep 17 00:00:00 2001 From: Enwei Date: Wed, 30 Mar 2022 14:01:35 +0800 Subject: [PATCH 4/7] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- tikv-configuration-file.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tikv-configuration-file.md b/tikv-configuration-file.md index 1fa236611d7d1..fd55f8a3dbbc5 100644 --- a/tikv-configuration-file.md +++ b/tikv-configuration-file.md @@ -1548,7 +1548,7 @@ For pessimistic transaction usage, refer to [TiDB Pessimistic Transaction Mode]( Configuration items related to Quota Limiter. -Suppose that your machine deployed TiKV has limited resources, for example, 4v CPU, 16 G memory. In this case, if the amount of requests processed by TiKV in the foreground is too large, the CPU resources for background processing are occupied by the foreground, causing TiKV performance to degrade. To avoid this issue, you can use the quota-related configuration items to limit the CPU resources used by the foreground. When requests trigger the Quota Limiter feature, the requests are forced to wait for a while to free up CPU resources. The exact waiting time depends on the amount of the requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-durationnew-in-v600). +Suppose that your machine on which TiKV is deployed has limited resources, for example, 4v CPU, 16 G memory. In this situation, if the foreground of TiKV processes too many read and write requests, the CPU resources in the background are used to help process such requests, affecting the performance stability of TiKV. To avoid this situation, you can use the quota-related configuration items to limit the CPU resources used by the foreground. When a request triggers the Quota Limiter, the request is forced to wait for a while for TiKV to free up CPU resources. The exact waiting time depends on the number of requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-duration-new-in-v600). > **Warning:** > @@ -1563,12 +1563,12 @@ Suppose that your machine deployed TiKV has limited resources, for example, 4v C ### `foreground-write-bandwidth` (new in v6.0.0) -+ The soft limit for transactions to write data. ++ The soft limit on the bandwidth with which transactions write data. + Default value: `0KB` (which means no limit) ### `foreground-read-bandwidth` (new in v6.0.0) -+ The soft limit for transactions and Coprocessor to read data. ++ The soft limit on the bandwidth with which transactions and the Coprocessor read data. + Default value: `0KB` (which means no limit) ### `max-delay-duration` (new in v6.0.0) From 7d901072701661e74aa7a4f874681bdc8eea16ab Mon Sep 17 00:00:00 2001 From: Enwei Date: Wed, 30 Mar 2022 14:09:28 +0800 Subject: [PATCH 5/7] Update tikv-configuration-file.md --- tikv-configuration-file.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tikv-configuration-file.md b/tikv-configuration-file.md index fd55f8a3dbbc5..ec71b0e0a8017 100644 --- a/tikv-configuration-file.md +++ b/tikv-configuration-file.md @@ -1548,7 +1548,7 @@ For pessimistic transaction usage, refer to [TiDB Pessimistic Transaction Mode]( Configuration items related to Quota Limiter. -Suppose that your machine on which TiKV is deployed has limited resources, for example, 4v CPU, 16 G memory. In this situation, if the foreground of TiKV processes too many read and write requests, the CPU resources in the background are used to help process such requests, affecting the performance stability of TiKV. To avoid this situation, you can use the quota-related configuration items to limit the CPU resources used by the foreground. When a request triggers the Quota Limiter, the request is forced to wait for a while for TiKV to free up CPU resources. The exact waiting time depends on the number of requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-duration-new-in-v600). +Suppose that your machine on which TiKV is deployed has limited resources, for example, 4v CPU, 16 G memory. In this situation, if the foreground of TiKV processes too many read and write requests, the CPU resources required by the background are used to help process such requests, affecting the performance stability of TiKV. To avoid this situation, you can use the quota-related configuration items to limit the CPU resources used by the foreground. When a request triggers the Quota Limiter, the request is forced to wait for a while for TiKV to free up CPU resources. The exact waiting time depends on the number of requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-duration-new-in-v600). > **Warning:** > From 0afd158a1b509d4955eb942b4df9ca02e04973a8 Mon Sep 17 00:00:00 2001 From: Enwei Date: Thu, 31 Mar 2022 18:31:53 +0800 Subject: [PATCH 6/7] Apply suggestions from code review Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com> --- tikv-configuration-file.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tikv-configuration-file.md b/tikv-configuration-file.md index 25acd0a9c8fa6..c598070a96b41 100644 --- a/tikv-configuration-file.md +++ b/tikv-configuration-file.md @@ -1557,7 +1557,7 @@ For pessimistic transaction usage, refer to [TiDB Pessimistic Transaction Mode]( Configuration items related to Quota Limiter. -Suppose that your machine on which TiKV is deployed has limited resources, for example, 4v CPU, 16 G memory. In this situation, if the foreground of TiKV processes too many read and write requests, the CPU resources required by the background are used to help process such requests, affecting the performance stability of TiKV. To avoid this situation, you can use the quota-related configuration items to limit the CPU resources used by the foreground. When a request triggers the Quota Limiter, the request is forced to wait for a while for TiKV to free up CPU resources. The exact waiting time depends on the number of requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-duration-new-in-v600). +Suppose that your machine on which TiKV is deployed has limited resources, for example, with only 4v CPU and 16 G memory. In this situation, if the foreground of TiKV processes too many read and write requests, the CPU resources used by the background are occupied to help process such requests, which affects the performance stability of TiKV. To avoid this situation, you can use the quota-related configuration items to limit the CPU resources to be used by the foreground. When a request triggers the Quota Limiter, the request is forced to wait for a while for TiKV to free up CPU resources. The exact waiting time depends on the number of requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-duration-new-in-v600). > **Warning:** > @@ -1566,7 +1566,7 @@ Suppose that your machine on which TiKV is deployed has limited resources, for e ### `foreground-cpu-time` (new in v6.0.0) -+ The soft limit on controlling the CPU resources used by TiKV foreground to process read and write requests. ++ The soft limit on the CPU resources used by TiKV foreground to process read and write requests. + Default value: `0` (which means no limit) + Unit: millicpu (for example, `1500` means that foreground requests consume 1.5v CPU) From d2341216406d04d43cd1d38e94781fc4076dbe56 Mon Sep 17 00:00:00 2001 From: Enwei Date: Thu, 31 Mar 2022 18:36:15 +0800 Subject: [PATCH 7/7] Apply suggestions from code review --- tikv-configuration-file.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tikv-configuration-file.md b/tikv-configuration-file.md index c598070a96b41..862485969592a 100644 --- a/tikv-configuration-file.md +++ b/tikv-configuration-file.md @@ -1557,7 +1557,7 @@ For pessimistic transaction usage, refer to [TiDB Pessimistic Transaction Mode]( Configuration items related to Quota Limiter. -Suppose that your machine on which TiKV is deployed has limited resources, for example, with only 4v CPU and 16 G memory. In this situation, if the foreground of TiKV processes too many read and write requests, the CPU resources used by the background are occupied to help process such requests, which affects the performance stability of TiKV. To avoid this situation, you can use the quota-related configuration items to limit the CPU resources to be used by the foreground. When a request triggers the Quota Limiter, the request is forced to wait for a while for TiKV to free up CPU resources. The exact waiting time depends on the number of requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-duration-new-in-v600). +Suppose that your machine on which TiKV is deployed has limited resources, for example, with only 4v CPU and 16 G memory. In this situation, if the foreground of TiKV processes too many read and write requests, the CPU resources used by the background are occupied to help process such requests, which affects the performance stability of TiKV. To avoid this situation, you can use the quota-related configuration items to limit the CPU resources to be used by the foreground. When a request triggers Quota Limiter, the request is forced to wait for a while for TiKV to free up CPU resources. The exact waiting time depends on the number of requests, and the maximum waiting time is no longer than the value of [`max-delay-duration`](#max-delay-duration-new-in-v600). > **Warning:** >