From cdec7d4da5dc794a0d32d337d7245adf43212231 Mon Sep 17 00:00:00 2001 From: xzhangxian1008 Date: Mon, 4 Nov 2024 13:56:10 +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 9b9f8bdf05c7..3dd2bad61c60 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -250,6 +250,15 @@ delta_index_cache_size = 0 ## 从 v7.4.0 引入,表示是否开启 TiFlash 资源管控功能。当设置为 true 时,TiFlash 会使用 Pipeline Model 执行模型。 enable_resource_control = true + ## 从 v6.0.0 引入,表示一个 resource group 中最多可使用的线程数量,默认值为 5000 + task_scheduler_thread_soft_limit = 5000 + + ## 从 v6.0.0 引入,表示全局最多可使用的线程数量,默认值为 10000 + task_scheduler_thread_hard_limit = 10000 + + ## 从 v6.4.0 引入,表示 TiFlash 实例同时运行的 query 数量,默认值为 0,即两倍 vcpu 数量 + task_scheduler_active_set_soft_limit = 0 + ## 安全相关配置,从 v4.0.5 开始生效 [security] ## 从 v5.0 引入,控制是否开启日志脱敏。可选值为 `true`、`false`、`"on"`、`"off"` 和 `"marker"`。其中,`"on"`、`"off"` 和 `"marker"` 从 v8.2.0 开始支持。 From 8e9b224ef5172733c2298df70a58e976779e9691 Mon Sep 17 00:00:00 2001 From: xzhangxian1008 Date: Mon, 4 Nov 2024 14:13:05 +0800 Subject: [PATCH 2/7] Update tiflash/tiflash-configuration.md Co-authored-by: xufei --- tiflash/tiflash-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index 3dd2bad61c60..e162c53be823 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -250,7 +250,7 @@ delta_index_cache_size = 0 ## 从 v7.4.0 引入,表示是否开启 TiFlash 资源管控功能。当设置为 true 时,TiFlash 会使用 Pipeline Model 执行模型。 enable_resource_control = true - ## 从 v6.0.0 引入,表示一个 resource group 中最多可使用的线程数量,默认值为 5000 + ## 从 v6.0.0 引入,用于 [MinTSO 调度器](/tiflash/tiflash-mintso-scheduler.md),表示一个 resource group 中最多可使用的线程数量,默认值为 5000 task_scheduler_thread_soft_limit = 5000 ## 从 v6.0.0 引入,表示全局最多可使用的线程数量,默认值为 10000 From 692f696721456d77b17ed2c4ef302db474c591ca Mon Sep 17 00:00:00 2001 From: xzhangxian1008 Date: Mon, 4 Nov 2024 14:13:10 +0800 Subject: [PATCH 3/7] Update tiflash/tiflash-configuration.md Co-authored-by: xufei --- tiflash/tiflash-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index e162c53be823..da79fe04b9bd 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -256,7 +256,7 @@ delta_index_cache_size = 0 ## 从 v6.0.0 引入,表示全局最多可使用的线程数量,默认值为 10000 task_scheduler_thread_hard_limit = 10000 - ## 从 v6.4.0 引入,表示 TiFlash 实例同时运行的 query 数量,默认值为 0,即两倍 vcpu 数量 + ## 从 v6.4.0 引入,用于 [MinTSO 调度器](/tiflash/tiflash-mintso-scheduler.md),表示 TiFlash 实例最多同时运行的 query 数量,默认值为 0,即两倍 vcpu 数量 task_scheduler_active_set_soft_limit = 0 ## 安全相关配置,从 v4.0.5 开始生效 From a95813261d8610c756b306d87e3e4f7e3bf60c58 Mon Sep 17 00:00:00 2001 From: xzhangxian1008 Date: Mon, 4 Nov 2024 14:13:17 +0800 Subject: [PATCH 4/7] Update tiflash/tiflash-configuration.md Co-authored-by: xufei --- tiflash/tiflash-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index da79fe04b9bd..de85d84d1847 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -253,7 +253,7 @@ delta_index_cache_size = 0 ## 从 v6.0.0 引入,用于 [MinTSO 调度器](/tiflash/tiflash-mintso-scheduler.md),表示一个 resource group 中最多可使用的线程数量,默认值为 5000 task_scheduler_thread_soft_limit = 5000 - ## 从 v6.0.0 引入,表示全局最多可使用的线程数量,默认值为 10000 + ## 从 v6.0.0 引入,用于 [MinTSO 调度器](/tiflash/tiflash-mintso-scheduler.md),表示全局最多可使用的线程数量,默认值为 10000 task_scheduler_thread_hard_limit = 10000 ## 从 v6.4.0 引入,用于 [MinTSO 调度器](/tiflash/tiflash-mintso-scheduler.md),表示 TiFlash 实例最多同时运行的 query 数量,默认值为 0,即两倍 vcpu 数量 From 60b6e39dd9345af18e854cbf2b20eec59eaac553 Mon Sep 17 00:00:00 2001 From: xzhangxian1008 Date: Tue, 19 Nov 2024 10:38:24 +0800 Subject: [PATCH 5/7] address comment --- 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 de85d84d1847..e1bdcbcf9503 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -250,13 +250,13 @@ delta_index_cache_size = 0 ## 从 v7.4.0 引入,表示是否开启 TiFlash 资源管控功能。当设置为 true 时,TiFlash 会使用 Pipeline Model 执行模型。 enable_resource_control = true - ## 从 v6.0.0 引入,用于 [MinTSO 调度器](/tiflash/tiflash-mintso-scheduler.md),表示一个 resource group 中最多可使用的线程数量,默认值为 5000 + ## 从 v6.0.0 引入,用于 MinTSO 调度器,表示一个资源组中最多可使用的线程数量,默认值为 5000。关于 MinTSO 调度器,详见 https://docs.pingcap.com/zh/tidb/dev/tiflash-mintso-scheduler task_scheduler_thread_soft_limit = 5000 - ## 从 v6.0.0 引入,用于 [MinTSO 调度器](/tiflash/tiflash-mintso-scheduler.md),表示全局最多可使用的线程数量,默认值为 10000 + ## 从 v6.0.0 引入,用于 MinTSO 调度器,表示全局最多可使用的线程数量,默认值为 10000。关于 MinTSO 调度器,详见 https://docs.pingcap.com/zh/tidb/dev/tiflash-mintso-scheduler task_scheduler_thread_hard_limit = 10000 - ## 从 v6.4.0 引入,用于 [MinTSO 调度器](/tiflash/tiflash-mintso-scheduler.md),表示 TiFlash 实例最多同时运行的 query 数量,默认值为 0,即两倍 vcpu 数量 + ## 从 v6.4.0 引入,用于 MinTSO 调度器,表示 TiFlash 实例最多可同时运行的查询数量,默认值为 0,即两倍的 vCPU 数量。关于 MinTSO 调度器,详见 https://docs.pingcap.com/zh/tidb/dev/tiflash-mintso-scheduler task_scheduler_active_set_soft_limit = 0 ## 安全相关配置,从 v4.0.5 开始生效 From 9ed75f6951ae858c94a14196436b7bb1077a39fa Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 19 Nov 2024 10:43:49 +0800 Subject: [PATCH 6/7] Update wording --- tiflash/tiflash-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index e1bdcbcf9503..95265d02d891 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -256,7 +256,7 @@ delta_index_cache_size = 0 ## 从 v6.0.0 引入,用于 MinTSO 调度器,表示全局最多可使用的线程数量,默认值为 10000。关于 MinTSO 调度器,详见 https://docs.pingcap.com/zh/tidb/dev/tiflash-mintso-scheduler task_scheduler_thread_hard_limit = 10000 - ## 从 v6.4.0 引入,用于 MinTSO 调度器,表示 TiFlash 实例最多可同时运行的查询数量,默认值为 0,即两倍的 vCPU 数量。关于 MinTSO 调度器,详见 https://docs.pingcap.com/zh/tidb/dev/tiflash-mintso-scheduler + ## 从 v6.4.0 引入,用于 MinTSO 调度器,表示一个 TiFlash 实例中最多可同时运行的查询数量,默认值为 0,即两倍的 vCPU 数量。关于 MinTSO 调度器,详见 https://docs.pingcap.com/zh/tidb/dev/tiflash-mintso-scheduler task_scheduler_active_set_soft_limit = 0 ## 安全相关配置,从 v4.0.5 开始生效 From 7abe276ebc75e38ee7f5662d30b9079132477cb8 Mon Sep 17 00:00:00 2001 From: lilin90 Date: Tue, 19 Nov 2024 11:57:47 +0800 Subject: [PATCH 7/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 2b47dce0791c..f4ae690f533a 100644 --- a/tiflash/tiflash-mintso-scheduler.md +++ b/tiflash/tiflash-mintso-scheduler.md @@ -60,3 +60,7 @@ MinTSO 调度器的目标是在控制系统线程数的同时,确保系统中 ![TiFlash MinTSO Scheduler v2](/media/tiflash/tiflash_mintso_v2.png) 通过引入 soft limit 与 hard limit,MinTSO 调度器在控制系统线程数的同时,有效地避免了系统死锁。不过对于高并发场景,可能会出现大多数查询都只有部分 MPP Task 被调度的情况。只有部分 MPP Task 被调度的查询无法正常执行,从而导致系统执行效率低下。为了避免这种情况,TiFlash 在查询层面为 MinTSO 调度器引入了一个限制,即 active_set_soft_limit,该限制要求系统最多只有 active_set_soft_limit 个查询的 MPP Task 可以参与调度;对于其它的查询,其 MPP Task 不参与调度,只有等当前查询结束之后,新的查询才能参与调度。该限制只是一个 soft limit,因为对于 MinTSO 查询来说,其所有 MPP Task 在系统线程数不超过 hard limit 时都可以直接被调度。 + +## 另请参阅 + +- [TiFlash 配置参数](/tiflash/tiflash-configuration.md):了解 MinTSO 调度器的相关配置。