This is an automated email from the ASF dual-hosted git repository. luzhijing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push: new 6abb24f7a3e fix dead link for workload-group (#657) 6abb24f7a3e is described below commit 6abb24f7a3e3a450c7133b53f2b7a81a6423624e Author: wangbo <youseebiggirl_...@qq.com> AuthorDate: Thu May 16 00:39:10 2024 +0800 fix dead link for workload-group (#657) --- docs/admin-manual/resource-admin/workload-group.md | 66 +++++++------------- .../admin-manual/resource-admin/workload-group.md | 56 ++++++----------- .../admin-manual/resource-admin/workload-group.md | 56 ++++++----------- .../admin-manual/resource-admin/workload-group.md | 70 ++++++++-------------- 4 files changed, 82 insertions(+), 166 deletions(-) diff --git a/docs/admin-manual/resource-admin/workload-group.md b/docs/admin-manual/resource-admin/workload-group.md index e3c4dab33de..9294af55019 100644 --- a/docs/admin-manual/resource-admin/workload-group.md +++ b/docs/admin-manual/resource-admin/workload-group.md @@ -73,6 +73,8 @@ Doris 2.0 version uses Doris scheduling to limit CPU resources, but since versio If users use the Workload Group software limit in version 2.0 and upgrade to version 2.1, they also need to configure CGroup, Otherwise, cpu soft limit may not work. +If using CGroup within a container, the container needs to have permission to operate the host. + Without configuring cgroup, users can use all functions of the workload group except for CPU limitations. 1 Firstly, confirm that the CGgroup v1 version has been installed on the node where BE is located, and the path ```/sys/fs/cgroup/cpu/``` exists. @@ -100,44 +102,20 @@ doris_cgroup_cpu_path = /sys/fs/cgroup/cpu/doris It should be noted that the current workload group does not support the deployment of multiple BE on same machine. ## Workload group usage - -1. Manually create a workload group named normal, which is the default workload group in the system and cannot be deleted. -``` -create workload group if not exists normal -properties ( - 'cpu_share'='1024', - 'memory_limit'='30%', - 'enable_memory_overcommit'='true' -); -``` -The function of a normal group is that when you do not specify a Workload Group for a query, the query will use normal Group, thus avoiding query failures. - -2. Enable the experimental_enable_workload_group configuration, set in fe.conf to -``` -experimental_enable_workload_group=true -``` -The system will automatically create a default workload group named ``normal`` after this configuration is enabled. - -3. If you expect to use other groups for testing, you can create a custom workload group, +1. First, create a custom workload group. ``` create workload group if not exists g1 properties ( - "cpu_share"="1024". - "memory_limit"="30%". + "cpu_share"="1024", + "memory_limit"="30%", "enable_memory_overcommit"="true" -). +); ``` -This configured CPU limit to the soft limit. +This is soft CPU limit. Since version 2.1, the system will automatically create a group named ` ` normal ` `, which cannot be deleted. -For details on creating a workload group, see [CREATE-WORKLOAD-GROUP](../sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-WORKLOAD-GROUP), and to delete a workload group, refer to [DROP-WORKLOAD-GROUP](../sql-manual/sql-reference/Data-Definition-Statements/Drop/DROP-WORKLOAD-GROUP); to modify a workload group, refer to [ALTER-WORKLOAD-GROUP](../sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-WORKLOAD-GROUP); to view the workload group, refer to: [WORKLOAD [...] - - -4. turn on the pipeline execution engine, the workload group cpu isolation is based on the implementation of the pipeline execution engine, so you need to turn on the session variable: -``` -set experimental_enable_pipeline_engine = true. -``` +For details on creating a workload group, see [CREATE-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Create/CREATE-WORKLOAD-GROUP), and to delete a workload group, refer to [DROP-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-WORKLOAD-GROUP); to modify a workload group, refer to [ALTER-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Alter/ALTER-WORKLOAD-GROUP); to view the workload group, you can [...] -5. Bind the workload group. +2. Bind the workload group. * Bind the user to the workload group by default by setting the user property to ``normal``. ``` set property 'default_workload_group' = 'g1'. @@ -145,17 +123,17 @@ set property 'default_workload_group' = 'g1'. The current user's query will use 'g1' by default. * Specify the workload group via the session variable, which defaults to null. ``` -set workload_group = 'g2'. +set workload_group = 'g1'. ``` session variable `workload_group` takes precedence over user property `default_workload_group`, in case `workload_group` is empty, the query will be bound to `default_workload_group`, in case session variable ` workload_group` is not empty, the query will be bound to `workload_group`. -If you are a non-admin user, you need to execute [SHOW-WORKLOAD-GROUPS](../sql-manual/sql-reference/Show-Statements/SHOW-WORKLOAD-GROUPS) to check if the current user can see the workload group, if not, the workload group may not exist or the current user does not have permission to execute the query. If you cannot see the workload group, the workload group may not exist or the current user does not have privileges. To authorize the workload group, refer to: [grant statement](../sql-manu [...] +If you are a non-admin user, you need to execute [SHOW-WORKLOAD-GROUPS](../../sql-manual/sql-statements/Show-Statements/SHOW-WORKLOAD-GROUPS) to check if the current user can see the workload group, if not, the workload group may not exist or the current user does not have permission to execute the query. If you cannot see the workload group, the workload group may not exist or the current user does not have privileges. To authorize the workload group, refer to: [grant statement](../../s [...] 6. Execute the query, which will be associated with the g1 workload group. ### Query Queue ``` -create workload group if not exists test_group +create workload group if not exists queue_group properties ( "cpu_share"="10", "memory_limit"="30%", @@ -184,18 +162,18 @@ ADMIN SET FRONTEND CONFIG ("enable_cpu_hard_limit" = "true"); 2 modify cpu_hard_limit ``` -alter workload group group1 properties ( 'cpu_hard_limit'='20%' ); +alter workload group g1 properties ( 'cpu_hard_limit'='20%' ); ``` 3 Viewing the current configuration of the Workload Group, it can be seen that although the cpu_share may not be 0, but due to the hard limit mode being enabled, the query will also follow the CPU's hard limit during execution. That is to say, the switch of CPU software and hardware limits does not affect workload group modification. ``` -mysql [(none)]>select name, cpu_share,memory_limit,enable_memory_overcommit,cpu_hard_limit from workload_groups() where name='group1'; -+--------+-----------+--------------+--------------------------+----------------+ -| Name | cpu_share | memory_limit | enable_memory_overcommit | cpu_hard_limit | -+--------+-----------+--------------+--------------------------+----------------+ -| group1 | 10 | 45% | true | 20% | -+--------+-----------+--------------+--------------------------+----------------+ -1 row in set (0.03 sec) +mysql [information_schema]>select name, cpu_share,memory_limit,enable_memory_overcommit,cpu_hard_limit from information_schema.workload_groups where name='g1'; ++------+-----------+--------------+--------------------------+----------------+ +| name | cpu_share | memory_limit | enable_memory_overcommit | cpu_hard_limit | ++------+-----------+--------------+--------------------------+----------------+ +| g1 | 1024 | 30% | true | 20% | ++------+-----------+--------------+--------------------------+----------------+ +1 row in set (0.02 sec) ``` ### How to switch CPU limit node between soft limit and hard limit @@ -205,7 +183,7 @@ Users can switch between two modes, and the main switching methods are as follow 1 If the current cluster configuration is set to the default CPU soft limit and it is expected to be changed to the CPU hard limit, then cpu_hard_limit should be set to a valid value first. ``` -alter workload group group1 properties ( 'cpu_hard_limit'='20%' ); +alter workload group test_group properties ( 'cpu_hard_limit'='20%' ); ``` It is necessary to modify cpu_hard_limit of all Workload Groups in the current cluster, sum of all Workload Group's cpu_hard_limit cannot exceed 100%. Due to the CPU's hard limit can not being able to provide a valid default value, if only the switch is turned on without modifying cpu_hard_limit, the CPU's hard limit will not work. @@ -220,4 +198,4 @@ ADMIN SET FRONTEND CONFIG ("enable_cpu_hard_limit" = "true"); ``` If user expects to switch back from cpu hard limit to cpu soft limit, then they only need to set ```enable_cpu_hard_limit=false```. -CPU Soft Limit property ```cpu_shared``` will be filled with a valid value of 1024 by default(If the user has never set the cpu_share before), and users can adjust cpu_share based on the priority of Workload Group. +CPU Soft Limit property ```cpu_share``` will be filled with a valid value of 1024 by default(If the user has never set the cpu_share before), and users can adjust cpu_share based on the priority of Workload Group. diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/resource-admin/workload-group.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/resource-admin/workload-group.md index e8467ba9c42..edfd4ef7b43 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/resource-admin/workload-group.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/admin-manual/resource-admin/workload-group.md @@ -71,6 +71,8 @@ Doris 的 2.0 版本使用基于 Doris 的调度实现 CPU 资源的限制,但 用户如果在 2.0 版本使用了 Workload Group 的软限并升级到了 2.1 版本,那么也需要配置 CGroup,否则可能导致软限失效。 +如果是在容器内使用 CGroup,需要容器具备操作宿主机的权限。 + 在不配置 cgroup 的情况下,用户可以使用 workload group 除 CPU 限制外的所有功能。 1 首先确认 BE 所在节点已经安装好 CGroup v1 版本,确认存在路径```/sys/fs/cgroup/cpu/```即可 @@ -98,24 +100,7 @@ doris_cgroup_cpu_path = /sys/fs/cgroup/cpu/doris 需要注意的是,目前的 workload group 暂时不支持一个机器多个 BE 的部署方式。 ## workload group 使用 - -1. 手动创建一个名为 normal 的 Workload Group,这个 Workload Group 为系统默认的 Workload Group,不可删除。 -``` -create workload group if not exists normal -properties ( - 'cpu_share'='1024', - 'memory_limit'='30%', - 'enable_memory_overcommit'='true' -); -``` -normal Group 的作用在于,当你不为查询指定 Workload Group 时,查询会默认使用该 Group,从而避免查询失败。 - -2. 开启 experimental_enable_workload_group 配置项,在 fe.conf 中设置: -``` -experimental_enable_workload_group=true -``` - -3. 如果期望使用其他 group 进行测试,那么可以创建一个自定义的 workload group, +1. 首先创建一个自定义的 workload group。 ``` create workload group if not exists g1 properties ( @@ -124,16 +109,11 @@ properties ( "enable_memory_overcommit"="true" ); ``` -此时配置的 CPU 限制为软限。 +此时配置的 CPU 限制为软限。自2.1版本起,系统会自动创建一个名为```normal```的group,不可删除。 -创建 workload group 详细可参考:[CREATE-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Create/CREATE-WORKLOAD-GROUP),另删除 workload group 可参考[DROP-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-WORKLOAD-GROUP);修改 workload group 可参考:[ALTER-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Alter/ALTER-WORKLOAD-GROUP);查看 workload group 可参考:[WORKLOAD_GROUPS()](../../sql-manual/sql-functions/table-functions/workl [...] - -4. 开启 pipeline 执行引擎,workload group cpu 隔离基于 pipeline 执行引擎实现,因此需开启 session 变量: -``` -set experimental_enable_pipeline_engine = true; -``` +创建 workload group 详细可参考:[CREATE-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Create/CREATE-WORKLOAD-GROUP),删除 workload group 可参考[DROP-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-WORKLOAD-GROUP);修改 workload group 可参考:[ALTER-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Alter/ALTER-WORKLOAD-GROUP);查看workload group可访问Doris系统表```information_schema.workload_groups```或者使用命令[SHOW-WORKLOAD-GROUPS] [...] -5. 绑定 workload group。 +2. 绑定 workload group。 * 通过设置 user property 将 user 默认绑定到 workload group,默认为`normal`: ``` set property 'default_workload_group' = 'g1'; @@ -141,17 +121,17 @@ set property 'default_workload_group' = 'g1'; 当前用户的查询将默认使用'g1'。 * 通过 session 变量指定 workload group, 默认为空: ``` -set workload_group = 'g2'; +set workload_group = 'g1'; ``` session 变量`workload_group`优先于 user property `default_workload_group`, 在`workload_group`为空时,查询将绑定到`default_workload_group`, 在 session 变量`workload_group`不为空时,查询将绑定到`workload_group`。 -如果是非 admin 用户,需要先执行[SHOW-WORKLOAD-GROUPS](../../sql-manual/sql-statements/Show-Statements/SHOW-WORKLOAD-GROUPS) 确认下当前用户能否看到该 workload group,不能看到的 workload group 可能不存在或者当前用户没有权限,执行查询时会报错。给 workload group 授权参考:[grant 语句](../../sql-manual/sql-statements/Account-Management-Statements/GRANT)。 +如果是非admin 用户,需要先执行[SHOW-WORKLOAD-GROUPS](../../sql-manual/sql-statements/Show-Statements/SHOW-WORKLOAD-GROUPS) 确认下当前用户能否看到该 workload group,不能看到的 workload group 可能不存在或者当前用户没有权限,执行查询时会报错。给 workload group 授权参考:[grant 语句](../../sql-manual/sql-statements/Account-Management-Statements/GRANT)。 6. 执行查询,查询将关联到指定的 workload group。 ### 查询排队功能 ``` -create workload group if not exists test_group +create workload group if not exists queue_group properties ( "cpu_share"="10", "memory_limit"="30%", @@ -181,18 +161,18 @@ ADMIN SET FRONTEND CONFIG ("enable_cpu_hard_limit" = "true"); 2 修改 Workload Group 的 cpu_hard_limit 属性 ``` -alter workload group group1 properties ( 'cpu_hard_limit'='20%' ); +alter workload group g1 properties ( 'cpu_hard_limit'='20%' ); ``` 3 查看当前的 Workload Group 的配置,可以看到尽管此时 cpu_share 的值可能不为 0,但是由于开启了硬限模式,那么查询在执行时也会走 CPU 的硬限。也就是说 CPU 软硬限的开关不影响元数据的修改。 ``` -mysql [(none)]>select name, cpu_share,memory_limit,enable_memory_overcommit,cpu_hard_limit from workload_groups() where name='group1'; -+--------+-----------+--------------+--------------------------+----------------+ -| Name | cpu_share | memory_limit | enable_memory_overcommit | cpu_hard_limit | -+--------+-----------+--------------+--------------------------+----------------+ -| group1 | 10 | 45% | true | 20% | -+--------+-----------+--------------+--------------------------+----------------+ -1 row in set (0.03 sec) +mysql [information_schema]>select name, cpu_share,memory_limit,enable_memory_overcommit,cpu_hard_limit from information_schema.workload_groups where name='g1'; ++------+-----------+--------------+--------------------------+----------------+ +| name | cpu_share | memory_limit | enable_memory_overcommit | cpu_hard_limit | ++------+-----------+--------------+--------------------------+----------------+ +| g1 | 1024 | 30% | true | 20% | ++------+-----------+--------------+--------------------------+----------------+ +1 row in set (0.02 sec) ``` ### CPU 软硬限模式切换的说明 @@ -201,7 +181,7 @@ mysql [(none)]>select name, cpu_share,memory_limit,enable_memory_overcommit,cpu_ 1 假如当前的集群配置是默认的 CPU 软限制,然后期望改成 CPU 的硬限,那么首先需要把 Workload Group 的 cpu_hard_limit 参数修改成一个有效的值 ``` -alter workload group group1 properties ( 'cpu_hard_limit'='20%' ); +alter workload group test_group properties ( 'cpu_hard_limit'='20%' ); ``` 需要修改当前集群中所有的 Workload Group 的这个属性,所有 Workload Group 的 cpu_hard_limit 的累加值不能超过 100% 由于 CPU 的硬限无法给出一个有效的默认值,因此如果只打开开关但是不修改属性,那么 CPU 的硬限也无法生效。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/admin-manual/resource-admin/workload-group.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/admin-manual/resource-admin/workload-group.md index e8467ba9c42..edfd4ef7b43 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/admin-manual/resource-admin/workload-group.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/admin-manual/resource-admin/workload-group.md @@ -71,6 +71,8 @@ Doris 的 2.0 版本使用基于 Doris 的调度实现 CPU 资源的限制,但 用户如果在 2.0 版本使用了 Workload Group 的软限并升级到了 2.1 版本,那么也需要配置 CGroup,否则可能导致软限失效。 +如果是在容器内使用 CGroup,需要容器具备操作宿主机的权限。 + 在不配置 cgroup 的情况下,用户可以使用 workload group 除 CPU 限制外的所有功能。 1 首先确认 BE 所在节点已经安装好 CGroup v1 版本,确认存在路径```/sys/fs/cgroup/cpu/```即可 @@ -98,24 +100,7 @@ doris_cgroup_cpu_path = /sys/fs/cgroup/cpu/doris 需要注意的是,目前的 workload group 暂时不支持一个机器多个 BE 的部署方式。 ## workload group 使用 - -1. 手动创建一个名为 normal 的 Workload Group,这个 Workload Group 为系统默认的 Workload Group,不可删除。 -``` -create workload group if not exists normal -properties ( - 'cpu_share'='1024', - 'memory_limit'='30%', - 'enable_memory_overcommit'='true' -); -``` -normal Group 的作用在于,当你不为查询指定 Workload Group 时,查询会默认使用该 Group,从而避免查询失败。 - -2. 开启 experimental_enable_workload_group 配置项,在 fe.conf 中设置: -``` -experimental_enable_workload_group=true -``` - -3. 如果期望使用其他 group 进行测试,那么可以创建一个自定义的 workload group, +1. 首先创建一个自定义的 workload group。 ``` create workload group if not exists g1 properties ( @@ -124,16 +109,11 @@ properties ( "enable_memory_overcommit"="true" ); ``` -此时配置的 CPU 限制为软限。 +此时配置的 CPU 限制为软限。自2.1版本起,系统会自动创建一个名为```normal```的group,不可删除。 -创建 workload group 详细可参考:[CREATE-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Create/CREATE-WORKLOAD-GROUP),另删除 workload group 可参考[DROP-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-WORKLOAD-GROUP);修改 workload group 可参考:[ALTER-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Alter/ALTER-WORKLOAD-GROUP);查看 workload group 可参考:[WORKLOAD_GROUPS()](../../sql-manual/sql-functions/table-functions/workl [...] - -4. 开启 pipeline 执行引擎,workload group cpu 隔离基于 pipeline 执行引擎实现,因此需开启 session 变量: -``` -set experimental_enable_pipeline_engine = true; -``` +创建 workload group 详细可参考:[CREATE-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Create/CREATE-WORKLOAD-GROUP),删除 workload group 可参考[DROP-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-WORKLOAD-GROUP);修改 workload group 可参考:[ALTER-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Alter/ALTER-WORKLOAD-GROUP);查看workload group可访问Doris系统表```information_schema.workload_groups```或者使用命令[SHOW-WORKLOAD-GROUPS] [...] -5. 绑定 workload group。 +2. 绑定 workload group。 * 通过设置 user property 将 user 默认绑定到 workload group,默认为`normal`: ``` set property 'default_workload_group' = 'g1'; @@ -141,17 +121,17 @@ set property 'default_workload_group' = 'g1'; 当前用户的查询将默认使用'g1'。 * 通过 session 变量指定 workload group, 默认为空: ``` -set workload_group = 'g2'; +set workload_group = 'g1'; ``` session 变量`workload_group`优先于 user property `default_workload_group`, 在`workload_group`为空时,查询将绑定到`default_workload_group`, 在 session 变量`workload_group`不为空时,查询将绑定到`workload_group`。 -如果是非 admin 用户,需要先执行[SHOW-WORKLOAD-GROUPS](../../sql-manual/sql-statements/Show-Statements/SHOW-WORKLOAD-GROUPS) 确认下当前用户能否看到该 workload group,不能看到的 workload group 可能不存在或者当前用户没有权限,执行查询时会报错。给 workload group 授权参考:[grant 语句](../../sql-manual/sql-statements/Account-Management-Statements/GRANT)。 +如果是非admin 用户,需要先执行[SHOW-WORKLOAD-GROUPS](../../sql-manual/sql-statements/Show-Statements/SHOW-WORKLOAD-GROUPS) 确认下当前用户能否看到该 workload group,不能看到的 workload group 可能不存在或者当前用户没有权限,执行查询时会报错。给 workload group 授权参考:[grant 语句](../../sql-manual/sql-statements/Account-Management-Statements/GRANT)。 6. 执行查询,查询将关联到指定的 workload group。 ### 查询排队功能 ``` -create workload group if not exists test_group +create workload group if not exists queue_group properties ( "cpu_share"="10", "memory_limit"="30%", @@ -181,18 +161,18 @@ ADMIN SET FRONTEND CONFIG ("enable_cpu_hard_limit" = "true"); 2 修改 Workload Group 的 cpu_hard_limit 属性 ``` -alter workload group group1 properties ( 'cpu_hard_limit'='20%' ); +alter workload group g1 properties ( 'cpu_hard_limit'='20%' ); ``` 3 查看当前的 Workload Group 的配置,可以看到尽管此时 cpu_share 的值可能不为 0,但是由于开启了硬限模式,那么查询在执行时也会走 CPU 的硬限。也就是说 CPU 软硬限的开关不影响元数据的修改。 ``` -mysql [(none)]>select name, cpu_share,memory_limit,enable_memory_overcommit,cpu_hard_limit from workload_groups() where name='group1'; -+--------+-----------+--------------+--------------------------+----------------+ -| Name | cpu_share | memory_limit | enable_memory_overcommit | cpu_hard_limit | -+--------+-----------+--------------+--------------------------+----------------+ -| group1 | 10 | 45% | true | 20% | -+--------+-----------+--------------+--------------------------+----------------+ -1 row in set (0.03 sec) +mysql [information_schema]>select name, cpu_share,memory_limit,enable_memory_overcommit,cpu_hard_limit from information_schema.workload_groups where name='g1'; ++------+-----------+--------------+--------------------------+----------------+ +| name | cpu_share | memory_limit | enable_memory_overcommit | cpu_hard_limit | ++------+-----------+--------------+--------------------------+----------------+ +| g1 | 1024 | 30% | true | 20% | ++------+-----------+--------------+--------------------------+----------------+ +1 row in set (0.02 sec) ``` ### CPU 软硬限模式切换的说明 @@ -201,7 +181,7 @@ mysql [(none)]>select name, cpu_share,memory_limit,enable_memory_overcommit,cpu_ 1 假如当前的集群配置是默认的 CPU 软限制,然后期望改成 CPU 的硬限,那么首先需要把 Workload Group 的 cpu_hard_limit 参数修改成一个有效的值 ``` -alter workload group group1 properties ( 'cpu_hard_limit'='20%' ); +alter workload group test_group properties ( 'cpu_hard_limit'='20%' ); ``` 需要修改当前集群中所有的 Workload Group 的这个属性,所有 Workload Group 的 cpu_hard_limit 的累加值不能超过 100% 由于 CPU 的硬限无法给出一个有效的默认值,因此如果只打开开关但是不修改属性,那么 CPU 的硬限也无法生效。 diff --git a/versioned_docs/version-2.1/admin-manual/resource-admin/workload-group.md b/versioned_docs/version-2.1/admin-manual/resource-admin/workload-group.md index e3c4dab33de..77c79dc82ba 100644 --- a/versioned_docs/version-2.1/admin-manual/resource-admin/workload-group.md +++ b/versioned_docs/version-2.1/admin-manual/resource-admin/workload-group.md @@ -1,7 +1,7 @@ --- { - "title": "Workload Group", - "language": "en" + "title": "Workload Group", + "language": "en" } --- @@ -73,6 +73,8 @@ Doris 2.0 version uses Doris scheduling to limit CPU resources, but since versio If users use the Workload Group software limit in version 2.0 and upgrade to version 2.1, they also need to configure CGroup, Otherwise, cpu soft limit may not work. +If using CGroup within a container, the container needs to have permission to operate the host. + Without configuring cgroup, users can use all functions of the workload group except for CPU limitations. 1 Firstly, confirm that the CGgroup v1 version has been installed on the node where BE is located, and the path ```/sys/fs/cgroup/cpu/``` exists. @@ -100,44 +102,20 @@ doris_cgroup_cpu_path = /sys/fs/cgroup/cpu/doris It should be noted that the current workload group does not support the deployment of multiple BE on same machine. ## Workload group usage - -1. Manually create a workload group named normal, which is the default workload group in the system and cannot be deleted. -``` -create workload group if not exists normal -properties ( - 'cpu_share'='1024', - 'memory_limit'='30%', - 'enable_memory_overcommit'='true' -); -``` -The function of a normal group is that when you do not specify a Workload Group for a query, the query will use normal Group, thus avoiding query failures. - -2. Enable the experimental_enable_workload_group configuration, set in fe.conf to -``` -experimental_enable_workload_group=true -``` -The system will automatically create a default workload group named ``normal`` after this configuration is enabled. - -3. If you expect to use other groups for testing, you can create a custom workload group, +1. First, create a custom workload group. ``` create workload group if not exists g1 properties ( - "cpu_share"="1024". - "memory_limit"="30%". + "cpu_share"="1024", + "memory_limit"="30%", "enable_memory_overcommit"="true" -). +); ``` -This configured CPU limit to the soft limit. +This is soft CPU limit. Since version 2.1, the system will automatically create a group named ` ` normal ` `, which cannot be deleted. -For details on creating a workload group, see [CREATE-WORKLOAD-GROUP](../sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-WORKLOAD-GROUP), and to delete a workload group, refer to [DROP-WORKLOAD-GROUP](../sql-manual/sql-reference/Data-Definition-Statements/Drop/DROP-WORKLOAD-GROUP); to modify a workload group, refer to [ALTER-WORKLOAD-GROUP](../sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-WORKLOAD-GROUP); to view the workload group, refer to: [WORKLOAD [...] - - -4. turn on the pipeline execution engine, the workload group cpu isolation is based on the implementation of the pipeline execution engine, so you need to turn on the session variable: -``` -set experimental_enable_pipeline_engine = true. -``` +For details on creating a workload group, see [CREATE-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Create/CREATE-WORKLOAD-GROUP), and to delete a workload group, refer to [DROP-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-WORKLOAD-GROUP); to modify a workload group, refer to [ALTER-WORKLOAD-GROUP](../../sql-manual/sql-statements/Data-Definition-Statements/Alter/ALTER-WORKLOAD-GROUP); to view the workload group, you can [...] -5. Bind the workload group. +2. Bind the workload group. * Bind the user to the workload group by default by setting the user property to ``normal``. ``` set property 'default_workload_group' = 'g1'. @@ -145,17 +123,17 @@ set property 'default_workload_group' = 'g1'. The current user's query will use 'g1' by default. * Specify the workload group via the session variable, which defaults to null. ``` -set workload_group = 'g2'. +set workload_group = 'g1'. ``` session variable `workload_group` takes precedence over user property `default_workload_group`, in case `workload_group` is empty, the query will be bound to `default_workload_group`, in case session variable ` workload_group` is not empty, the query will be bound to `workload_group`. -If you are a non-admin user, you need to execute [SHOW-WORKLOAD-GROUPS](../sql-manual/sql-reference/Show-Statements/SHOW-WORKLOAD-GROUPS) to check if the current user can see the workload group, if not, the workload group may not exist or the current user does not have permission to execute the query. If you cannot see the workload group, the workload group may not exist or the current user does not have privileges. To authorize the workload group, refer to: [grant statement](../sql-manu [...] +If you are a non-admin user, you need to execute [SHOW-WORKLOAD-GROUPS](../../sql-manual/sql-statements/Show-Statements/SHOW-WORKLOAD-GROUPS) to check if the current user can see the workload group, if not, the workload group may not exist or the current user does not have permission to execute the query. If you cannot see the workload group, the workload group may not exist or the current user does not have privileges. To authorize the workload group, refer to: [grant statement](../../s [...] 6. Execute the query, which will be associated with the g1 workload group. ### Query Queue ``` -create workload group if not exists test_group +create workload group if not exists queue_group properties ( "cpu_share"="10", "memory_limit"="30%", @@ -184,18 +162,18 @@ ADMIN SET FRONTEND CONFIG ("enable_cpu_hard_limit" = "true"); 2 modify cpu_hard_limit ``` -alter workload group group1 properties ( 'cpu_hard_limit'='20%' ); +alter workload group g1 properties ( 'cpu_hard_limit'='20%' ); ``` 3 Viewing the current configuration of the Workload Group, it can be seen that although the cpu_share may not be 0, but due to the hard limit mode being enabled, the query will also follow the CPU's hard limit during execution. That is to say, the switch of CPU software and hardware limits does not affect workload group modification. ``` -mysql [(none)]>select name, cpu_share,memory_limit,enable_memory_overcommit,cpu_hard_limit from workload_groups() where name='group1'; -+--------+-----------+--------------+--------------------------+----------------+ -| Name | cpu_share | memory_limit | enable_memory_overcommit | cpu_hard_limit | -+--------+-----------+--------------+--------------------------+----------------+ -| group1 | 10 | 45% | true | 20% | -+--------+-----------+--------------+--------------------------+----------------+ -1 row in set (0.03 sec) +mysql [information_schema]>select name, cpu_share,memory_limit,enable_memory_overcommit,cpu_hard_limit from information_schema.workload_groups where name='g1'; ++------+-----------+--------------+--------------------------+----------------+ +| name | cpu_share | memory_limit | enable_memory_overcommit | cpu_hard_limit | ++------+-----------+--------------+--------------------------+----------------+ +| g1 | 1024 | 30% | true | 20% | ++------+-----------+--------------+--------------------------+----------------+ +1 row in set (0.02 sec) ``` ### How to switch CPU limit node between soft limit and hard limit @@ -205,7 +183,7 @@ Users can switch between two modes, and the main switching methods are as follow 1 If the current cluster configuration is set to the default CPU soft limit and it is expected to be changed to the CPU hard limit, then cpu_hard_limit should be set to a valid value first. ``` -alter workload group group1 properties ( 'cpu_hard_limit'='20%' ); +alter workload group test_group properties ( 'cpu_hard_limit'='20%' ); ``` It is necessary to modify cpu_hard_limit of all Workload Groups in the current cluster, sum of all Workload Group's cpu_hard_limit cannot exceed 100%. Due to the CPU's hard limit can not being able to provide a valid default value, if only the switch is turned on without modifying cpu_hard_limit, the CPU's hard limit will not work. @@ -220,4 +198,4 @@ ADMIN SET FRONTEND CONFIG ("enable_cpu_hard_limit" = "true"); ``` If user expects to switch back from cpu hard limit to cpu soft limit, then they only need to set ```enable_cpu_hard_limit=false```. -CPU Soft Limit property ```cpu_shared``` will be filled with a valid value of 1024 by default(If the user has never set the cpu_share before), and users can adjust cpu_share based on the priority of Workload Group. +CPU Soft Limit property ```cpu_share``` will be filled with a valid value of 1024 by default(If the user has never set the cpu_share before), and users can adjust cpu_share based on the priority of Workload Group. --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org