From 88d92f76d20e58df97add0f26638749351552b3c Mon Sep 17 00:00:00 2001 From: xzhangxian1008 Date: Tue, 19 Nov 2024 08:51:17 +0800 Subject: [PATCH 1/7] init --- tiflash/tiflash-configuration.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index 173346501b720..5f1b97f57a764 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -220,6 +220,15 @@ delta_index_cache_size = 0 dt_page_gc_threshold = 0.5 + ## New in v6.0.0. This item is used for [MinTSO scheduler](/tiflash/tiflash-mintso-scheduler.md) and specifies the max number of threads that one resource group could use. The default value is 5000. + task_scheduler_thread_soft_limit = 5000 + + ## New in v6.0.0. This item is used for [MinTSO scheduler](/tiflash/tiflash-mintso-scheduler.md) and specifies the max number of threads in global scope. The default value is 10000. + task_scheduler_thread_hard_limit = 10000 + + ## New in v6.4.0. This item is used for [MinTSO scheduler](/tiflash/tiflash-mintso-scheduler.md) and specifies the max number of running queries in a TiFlash instance. The default value is 0 which means two times the vcpu. + task_scheduler_active_set_soft_limit = 0 + ## Security settings take effect starting from v4.0.5. [security] ## New in v5.0. This configuration item enables or disables log redaction. If the configuration value From acc2c647ca75c7bf0e6960122329cea940eda4b0 Mon Sep 17 00:00:00 2001 From: xzhangxian1008 Date: Tue, 19 Nov 2024 10:39:43 +0800 Subject: [PATCH 2/7] address comments --- tiflash/tiflash-configuration.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index 5f1b97f57a764..c3e18906070e9 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -220,13 +220,13 @@ delta_index_cache_size = 0 dt_page_gc_threshold = 0.5 - ## New in v6.0.0. This item is used for [MinTSO scheduler](/tiflash/tiflash-mintso-scheduler.md) and specifies the max number of threads that one resource group could use. The default value is 5000. + ## New in v6.0.0. This item is used for MinTSO scheduler. It specifies the maximum number of threads that one resource group can use. The default value is 5000. For details about MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. task_scheduler_thread_soft_limit = 5000 - ## New in v6.0.0. This item is used for [MinTSO scheduler](/tiflash/tiflash-mintso-scheduler.md) and specifies the max number of threads in global scope. The default value is 10000. + ## New in v6.0.0. This item is used for MinTSO scheduler. It specifies the maximum number of threads in the global scope. The default value is 10000. For details about MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. task_scheduler_thread_hard_limit = 10000 - ## New in v6.4.0. This item is used for [MinTSO scheduler](/tiflash/tiflash-mintso-scheduler.md) and specifies the max number of running queries in a TiFlash instance. The default value is 0 which means two times the vcpu. + ## New in v6.4.0. This item is used for MinTSO scheduler. It specifies the maximum number of queries that can run simultaneously in a TiFlash instance. The default value is 0, which means twice the number of vCPUs. For details about MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. task_scheduler_active_set_soft_limit = 0 ## Security settings take effect starting from v4.0.5. From f6e0d76febd6805a1bbf28200fc23afec9f8fcd4 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 19 Nov 2024 11:51:24 +0800 Subject: [PATCH 3/7] Update wording --- tiflash/tiflash-configuration.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index c3e18906070e9..06d5985bf2336 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -220,13 +220,13 @@ delta_index_cache_size = 0 dt_page_gc_threshold = 0.5 - ## New in v6.0.0. This item is used for MinTSO scheduler. It specifies the maximum number of threads that one resource group can use. The default value is 5000. For details about MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. + ## New in v6.0.0. This item is used for the MinTSO scheduler. It specifies the maximum number of threads that one resource group can use. The default value is 5000. For details about MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. task_scheduler_thread_soft_limit = 5000 - ## New in v6.0.0. This item is used for MinTSO scheduler. It specifies the maximum number of threads in the global scope. The default value is 10000. For details about MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. + ## New in v6.0.0. This item is used for the MinTSO scheduler. It specifies the maximum number of threads in the global scope. The default value is 10000. For details about MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. task_scheduler_thread_hard_limit = 10000 - ## New in v6.4.0. This item is used for MinTSO scheduler. It specifies the maximum number of queries that can run simultaneously in a TiFlash instance. The default value is 0, which means twice the number of vCPUs. For details about MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. + ## New in v6.4.0. This item is used for the MinTSO scheduler. It specifies the maximum number of queries that can run simultaneously in a TiFlash instance. The default value is 0, which means twice the number of vCPUs. For details about MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. task_scheduler_active_set_soft_limit = 0 ## Security settings take effect starting from v4.0.5. From d1211830dbd5501985d0ce1a0e77e62cf3e0fbbf Mon Sep 17 00:00:00 2001 From: lilin90 Date: Tue, 19 Nov 2024 12:01:13 +0800 Subject: [PATCH 4/7] Update tiflash-mintso-scheduler.md --- tiflash/tiflash-mintso-scheduler.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tiflash/tiflash-mintso-scheduler.md b/tiflash/tiflash-mintso-scheduler.md index 3b925c7dae14c..2c65357d9c355 100644 --- a/tiflash/tiflash-mintso-scheduler.md +++ b/tiflash/tiflash-mintso-scheduler.md @@ -62,3 +62,7 @@ The scheduling process of the MinTSO Scheduler is as follows: ![TiFlash MinTSO Scheduler v2](/media/tiflash/tiflash_mintso_v2.png) By introducing soft limit and hard limit, the MinTSO scheduler effectively avoids system deadlock while controlling the number of system threads. In high concurrency scenarios, however, most queries might only have part of their MPP tasks scheduled. Queries with only part of MPP tasks scheduled cannot execute normally, leading to low system execution efficiency. To avoid this situation, TiFlash introduces a query-level limit for the MinTSO scheduler, called active_set_soft_limit. This limit allows only MPP tasks of up to active_set_soft_limit queries to participate in scheduling; MPP tasks of other queries do not participate in scheduling, and only after the current queries finish can new queries participate in scheduling. This limit is only a soft limit because for the MinTSO query, all its MPP tasks can be scheduled directly as long as the number of system threads does not exceed the hard limit. + +# See also + +- [TiFlash Configuration](/tiflash/tiflash-configuration.md): learn how to configure the MinTSO scheduler. From 5e3735f5d02f3d4d94aa7800e7847fb9f97ddff7 Mon Sep 17 00:00:00 2001 From: lilin90 Date: Tue, 19 Nov 2024 12:02:00 +0800 Subject: [PATCH 5/7] Update tiflash-mintso-scheduler.md --- tiflash/tiflash-mintso-scheduler.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiflash/tiflash-mintso-scheduler.md b/tiflash/tiflash-mintso-scheduler.md index 2c65357d9c355..64ab4195c5aa2 100644 --- a/tiflash/tiflash-mintso-scheduler.md +++ b/tiflash/tiflash-mintso-scheduler.md @@ -65,4 +65,4 @@ By introducing soft limit and hard limit, the MinTSO scheduler effectively avoid # See also -- [TiFlash Configuration](/tiflash/tiflash-configuration.md): learn how to configure the MinTSO scheduler. +- [Configure TiFlash](/tiflash/tiflash-configuration.md): learn how to configure the MinTSO scheduler. From 9a5e2e968653fdbae8747556f838c68073d972f6 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 19 Nov 2024 12:06:59 +0800 Subject: [PATCH 6/7] Update wording --- tiflash/tiflash-configuration.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index 06d5985bf2336..f97fddcffca58 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -220,13 +220,13 @@ delta_index_cache_size = 0 dt_page_gc_threshold = 0.5 - ## New in v6.0.0. This item is used for the MinTSO scheduler. It specifies the maximum number of threads that one resource group can use. The default value is 5000. For details about MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. + ## New in v6.0.0. This item is used for the MinTSO scheduler. It specifies the maximum number of threads that one resource group can use. The default value is 5000. For details about the MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. task_scheduler_thread_soft_limit = 5000 - ## New in v6.0.0. This item is used for the MinTSO scheduler. It specifies the maximum number of threads in the global scope. The default value is 10000. For details about MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. + ## New in v6.0.0. This item is used for the MinTSO scheduler. It specifies the maximum number of threads in the global scope. The default value is 10000. For details about the MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. task_scheduler_thread_hard_limit = 10000 - ## New in v6.4.0. This item is used for the MinTSO scheduler. It specifies the maximum number of queries that can run simultaneously in a TiFlash instance. The default value is 0, which means twice the number of vCPUs. For details about MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. + ## New in v6.4.0. This item is used for the MinTSO scheduler. It specifies the maximum number of queries that can run simultaneously in a TiFlash instance. The default value is 0, which means twice the number of vCPUs. For details about the MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. task_scheduler_active_set_soft_limit = 0 ## Security settings take effect starting from v4.0.5. From 87749106db824be7d67489ff3de0e9b5ee188f21 Mon Sep 17 00:00:00 2001 From: lilin90 Date: Thu, 21 Nov 2024 15:22:48 +0800 Subject: [PATCH 7/7] Update links --- tiflash/tiflash-configuration.md | 7 +++---- tiflash/tiflash-mintso-scheduler.md | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index f97fddcffca58..afc10340da21f 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -219,14 +219,13 @@ delta_index_cache_size = 0 ## New in v6.2.0. This item specifies the minimum ratio of valid data in a PageStorage data file. When the ratio of valid data in a PageStorage data file is less than the value of this configuration, GC is triggered to compact data in the file. The default value is 0.5. dt_page_gc_threshold = 0.5 - - ## New in v6.0.0. This item is used for the MinTSO scheduler. It specifies the maximum number of threads that one resource group can use. The default value is 5000. For details about the MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. + ## New in v6.0.0. This item is used for the MinTSO scheduler. It specifies the maximum number of threads that one resource group can use. The default value is 5000. For details about the MinTSO scheduler, see https://docs.pingcap.com/tidb/v6.5/tiflash-mintso-scheduler. task_scheduler_thread_soft_limit = 5000 - ## New in v6.0.0. This item is used for the MinTSO scheduler. It specifies the maximum number of threads in the global scope. The default value is 10000. For details about the MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. + ## New in v6.0.0. This item is used for the MinTSO scheduler. It specifies the maximum number of threads in the global scope. The default value is 10000. For details about the MinTSO scheduler, see https://docs.pingcap.com/tidb/v6.5/tiflash-mintso-scheduler. task_scheduler_thread_hard_limit = 10000 - ## New in v6.4.0. This item is used for the MinTSO scheduler. It specifies the maximum number of queries that can run simultaneously in a TiFlash instance. The default value is 0, which means twice the number of vCPUs. For details about the MinTSO scheduler, see https://docs.pingcap.com/tidb/dev/tiflash-mintso-scheduler. + ## New in v6.4.0. This item is used for the MinTSO scheduler. It specifies the maximum number of queries that can run simultaneously in a TiFlash instance. The default value is 0, which means twice the number of vCPUs. For details about the MinTSO scheduler, see https://docs.pingcap.com/tidb/v6.5/tiflash-mintso-scheduler. task_scheduler_active_set_soft_limit = 0 ## Security settings take effect starting from v4.0.5. diff --git a/tiflash/tiflash-mintso-scheduler.md b/tiflash/tiflash-mintso-scheduler.md index 64ab4195c5aa2..e367dcc64aba2 100644 --- a/tiflash/tiflash-mintso-scheduler.md +++ b/tiflash/tiflash-mintso-scheduler.md @@ -63,6 +63,6 @@ The scheduling process of the MinTSO Scheduler is as follows: By introducing soft limit and hard limit, the MinTSO scheduler effectively avoids system deadlock while controlling the number of system threads. In high concurrency scenarios, however, most queries might only have part of their MPP tasks scheduled. Queries with only part of MPP tasks scheduled cannot execute normally, leading to low system execution efficiency. To avoid this situation, TiFlash introduces a query-level limit for the MinTSO scheduler, called active_set_soft_limit. This limit allows only MPP tasks of up to active_set_soft_limit queries to participate in scheduling; MPP tasks of other queries do not participate in scheduling, and only after the current queries finish can new queries participate in scheduling. This limit is only a soft limit because for the MinTSO query, all its MPP tasks can be scheduled directly as long as the number of system threads does not exceed the hard limit. -# See also +## See also - [Configure TiFlash](/tiflash/tiflash-configuration.md): learn how to configure the MinTSO scheduler.