Skip to content

Commit 8be17ab

Browse files
committed
update workload group docs about create and alter, show
1 parent f8b8948 commit 8be17ab

File tree

12 files changed

+286
-146
lines changed

12 files changed

+286
-146
lines changed

docs/sql-manual/sql-statements/cluster-management/compute-management/ALTER-WORKLOAD-GROUP.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,7 @@ PROPERTIES (
2323

2424
1.`<property>`
2525

26-
`<property>` 格式为 `<key>` = `<value>``<key>`的具体可选值如下:
27-
28-
| Parameter | Description | Required |
29-
| -- | -- | -- |
30-
| `<cpu_share>` | used to set how much cpu time the workload group can acquire, which can achieve soft isolation of cpu resources. cpu_share is a relative value indicating the weight of cpu resources available to the running workload group. For example, if a user creates 3 workload groups rg-a, rg-b and rg-c with cpu_share of 10, 30 and 40 respectively, and at a certain moment rg-a and rg-b are running tasks while rg-c has no tasks, then rg-a can get (10 / (10 + 30)) = 25% of the cpu resources while workload group rg-b can get 75% of the cpu resources. If the system has only one workload group running, it gets all the cpu resources regardless of the value of its cpu_share. | Y |
31-
| `<memory_limit>` | set the percentage of be memory that can be used by the workload group. The absolute value of the workload group memory limit is: `physical_memory * mem_limit * memory_limit`, where mem_limit is a be configuration item. The total memory_limit of all workload groups in the system must not exceed 100%. Workload groups are guaranteed to use the memory_limit for the tasks in the group in most cases. When the workload group memory usage exceeds this limit, tasks in the group with larger memory usage may be canceled to release the excess memory, refer to enable_memory_overcommit. | Y |
32-
| `<enable_memory_overcommit>` | enable soft memory isolation for the workload group, default is false. if set to false, the workload group is hard memory isolated and the tasks with the largest memory usage will be canceled immediately after the workload group memory usage exceeds the limit to release the excess memory. if set to true, the workload group is hard memory isolated and the tasks with the largest memory usage will be canceled immediately after the workload group memory usage exceeds the limit to release the excess memory. if set to true, the workload group is softly isolated, if the system has free memory resources, the workload group can continue to use system memory after exceeding the memory_limit limit, and when the total system memory is tight, it will cancel several tasks in the group with the largest memory occupation, releasing part of the excess memory to relieve the system memory pressure. It is recommended that when this configuration is enabled for a workload group, the total memory_limit of all workload groups should be less than 100%, and the remaining portion should be used for workload group memory overcommit. | Y |
33-
26+
`<property>` format is `<key>` = `<value>``<key>`'s specific optional values can be referred to [workload group](../../../../admin-manual/workload-management/workload-group.md).
3427

3528
## Examples
3629

@@ -39,7 +32,7 @@ PROPERTIES (
3932
```sql
4033
alter workload group g1
4134
properties (
42-
"cpu_share"="30",
43-
"memory_limit"="30%"
35+
"max_cpu_percent"="20%",
36+
"max_memory_percent"="40%"
4437
);
4538
```

docs/sql-manual/sql-statements/cluster-management/compute-management/CREATE-WORKLOAD-GROUP.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,7 @@ PROPERTIES (
2323

2424
1.`<property>`
2525

26-
`<property>` 格式为 `<key>` = `<value>``<key>`的具体可选值如下:
27-
28-
| Parameter | Description | Required |
29-
| -- | -- | -- |
30-
| `<cpu_share>` | used to set how much cpu time the workload group can acquire, which can achieve soft isolation of cpu resources. cpu_share is a relative value indicating the weight of cpu resources available to the running workload group. For example, if a user creates 3 workload groups rg-a, rg-b and rg-c with cpu_share of 10, 30 and 40 respectively, and at a certain moment rg-a and rg-b are running tasks while rg-c has no tasks, then rg-a can get (10 / (10 + 30)) = 25% of the cpu resources while workload group rg-b can get 75% of the cpu resources. If the system has only one workload group running, it gets all the cpu resources regardless of the value of its cpu_share. | Y |
31-
| `<memory_limit>` | set the percentage of be memory that can be used by the workload group. The absolute value of the workload group memory limit is: `physical_memory * mem_limit * memory_limit`, where mem_limit is a be configuration item. The total memory_limit of all workload groups in the system must not exceed 100%. Workload groups are guaranteed to use the memory_limit for the tasks in the group in most cases. When the workload group memory usage exceeds this limit, tasks in the group with larger memory usage may be canceled to release the excess memory, refer to enable_memory_overcommit. | Y |
32-
| `<enable_memory_overcommit>` | enable soft memory isolation for the workload group, default is false. if set to false, the workload group is hard memory isolated and the tasks with the largest memory usage will be canceled immediately after the workload group memory usage exceeds the limit to release the excess memory. if set to true, the workload group is hard memory isolated and the tasks with the largest memory usage will be canceled immediately after the workload group memory usage exceeds the limit to release the excess memory. if set to true, the workload group is softly isolated, if the system has free memory resources, the workload group can continue to use system memory after exceeding the memory_limit limit, and when the total system memory is tight, it will cancel several tasks in the group with the largest memory occupation, releasing part of the excess memory to relieve the system memory pressure. It is recommended that when this configuration is enabled for a workload group, the total memory_limit of all workload groups should be less than 100%, and the remaining portion should be used for workload group memory overcommit. | Y |
26+
`<property>` format is `<key>` = `<value>``<key>`'s specific optional values can be referred to [workload group](../../../../admin-manual/workload-management/workload-group.md).
3327

3428

3529
## Examples
@@ -39,8 +33,7 @@ PROPERTIES (
3933
```sql
4034
create workload group if not exists g1
4135
properties (
42-
"cpu_share"="10",
43-
"memory_limit"="30%",
44-
"enable_memory_overcommit"="true"
36+
"max_cpu_percent"="10%",
37+
"max_memory_percent"="30%"
4538
);
4639
```

docs/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md

Lines changed: 65 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,74 @@ This statement only does a simple display of workload groups, for a more complex
2424
1. Show all workload groups:
2525

2626
```sql
27-
mysql> show workload groups;
28-
+----------+--------+--------------------------+---------+
29-
| Id | Name | Item | Value |
30-
+----------+--------+--------------------------+---------+
31-
| 10343386 | normal | cpu_share | 10 |
32-
| 10343386 | normal | memory_limit | 30% |
33-
| 10343386 | normal | enable_memory_overcommit | true |
34-
| 10352416 | g1 | memory_limit | 20% |
35-
| 10352416 | g1 | cpu_share | 10 |
36-
+----------+--------+--------------------------+---------+
27+
mysql> show workload groups \G;
28+
*************************** 1. row ***************************
29+
Id: 1754728930516
30+
Name: normal
31+
min_cpu_percent: 20%
32+
max_cpu_percent: 30%
33+
min_memory_percent: 0%
34+
max_memory_percent: 50%
35+
max_concurrency: 1
36+
max_queue_size: 1
37+
queue_timeout: 0
38+
scan_thread_num: 16
39+
max_remote_scan_thread_num: -1
40+
min_remote_scan_thread_num: -1
41+
memory_low_watermark: 75%
42+
memory_high_watermark: 85%
43+
compute_group: default
44+
read_bytes_per_second: -1
45+
remote_read_bytes_per_second: -1
46+
slot_memory_policy: none
47+
running_query_num: 0
48+
waiting_query_num: 0
49+
*************************** 2. row ***************************
50+
Id: 1754740507946
51+
Name: test_group2
52+
min_cpu_percent: 10%
53+
max_cpu_percent: 30%
54+
min_memory_percent: 0%
55+
max_memory_percent: 3%
56+
max_concurrency: 2147483647
57+
max_queue_size: 0
58+
queue_timeout: 0
59+
scan_thread_num: -1
60+
max_remote_scan_thread_num: -1
61+
min_remote_scan_thread_num: -1
62+
memory_low_watermark: 75%
63+
memory_high_watermark: 85%
64+
compute_group: default
65+
read_bytes_per_second: -1
66+
remote_read_bytes_per_second: -1
67+
slot_memory_policy: none
68+
running_query_num: 0
69+
waiting_query_num: 0
3770
```
3871

3972
2. Show workload groups using pattern
4073

4174
```sql
42-
mysql> show workload groups like "normal%";
43-
+----------+--------+--------------------------+---------+
44-
| Id | Name | Item | Value |
45-
+----------+--------+--------------------------+---------+
46-
| 10343386 | normal | cpu_share | 10 |
47-
| 10343386 | normal | memory_limit | 30% |
48-
| 10343386 | normal | enable_memory_overcommit | true |
49-
+----------+--------+--------------------------+---------+
75+
mysql> show workload groups like "normal%" \G;
76+
*************************** 1. row ***************************
77+
Id: 1754728930516
78+
Name: normal
79+
min_cpu_percent: 20%
80+
max_cpu_percent: 30%
81+
min_memory_percent: 0%
82+
max_memory_percent: 50%
83+
max_concurrency: 1
84+
max_queue_size: 1
85+
queue_timeout: 0
86+
scan_thread_num: 16
87+
max_remote_scan_thread_num: -1
88+
min_remote_scan_thread_num: -1
89+
memory_low_watermark: 75%
90+
memory_high_watermark: 85%
91+
compute_group: default
92+
read_bytes_per_second: -1
93+
remote_read_bytes_per_second: -1
94+
slot_memory_policy: none
95+
running_query_num: 0
96+
waiting_query_num: 0
5097
```

i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/cluster-management/compute-management/ALTER-WORKLOAD-GROUP.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,8 @@ PROPERTIES (
2323

2424
1.`<property>`
2525

26-
`<property>` 格式为 `<key>` = `<value>``<key>`的具体可选值如下:
26+
`<property>` 格式为 `<key>` = `<value>``<key>`的具体可选值可以参考[workload group](../../../../admin-manual/workload-management/workload-group.md).
2727

28-
| 参数 | 说明 | 是否必填 |
29-
| -- | -- | -- |
30-
| `<cpu_share>` | 用于设置资源组获取 cpu 时间的多少,可以实现 cpu 资源软隔离。cpu_share 是相对值,表示正在运行的资源组可获取 cpu 资源的权重。例如,用户创建了 3 个资源组 rg-a、rg-b 和 rg-c,cpu_share 分别为 10、30、40,某一时刻 rg-a 和 rg-b 正在跑任务,而 rg-c 没有任务,此时 rg-a 可获得 (10 / (10 + 30)) = 25% 的 cpu 资源,而资源组 rg-b 可获得 75% 的 cpu 资源。如果系统只有一个资源组正在运行,则不管其 cpu_share 的值为多少,它都可以获取全部的 cpu 资源。 ||
31-
| `<memory_limit>` | 用于设置资源组可以使用 be 内存的百分比。资源组内存限制的绝对值为:`物理内存 * mem_limit * memory_limit`,其中 mem_limit 为 be 配置项。系统所有资源组的 memory_limit 总合不可超过 100%。资源组在绝大多数情况下保证组内任务可使用 memory_limit 的内存,当资源组内存使用超出该限制后,组内内存占用较大的任务可能会被 cancel 以释放超出的内存,参考 enable_memory_overcommit。 ||
32-
| `<enable_memory_overcommit>` | 用于开启资源组内存软隔离,默认为 false。如果设置为 false,则该资源组为内存硬隔离,系统检测到资源组内存使用超出限制后将立即 cancel 组内内存占用最大的若干个任务,以释放超出的内存;如果设置为 true,则该资源组为内存软隔离,如果系统有空闲内存资源则该资源组在超出 memory_limit 的限制后可继续使用系统内存,在系统总内存紧张时会 cancel 组内内存占用最大的若干个任务,释放部分超出的内存以缓解系统内存压力。建议在有资源组开启该配置时,所有资源组的 memory_limit 总和低于 100%,剩余部分用于资源组内存超发。 ||
3328

3429
## 示例
3530

@@ -38,7 +33,7 @@ PROPERTIES (
3833
```sql
3934
alter workload group g1
4035
properties (
41-
"cpu_share"="30",
42-
"memory_limit"="30%"
36+
"max_cpu_percent"="20%",
37+
"max_memory_percent"="40%"
4338
);
4439
```

i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/cluster-management/compute-management/CREATE-WORKLOAD-GROUP.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,8 @@ PROPERTIES (
2323

2424
1.`<property>`
2525

26-
`<property>` 格式为 `<key>` = `<value>``<key>`的具体可选值如下:
26+
`<property>` 格式为 `<key>` = `<value>``<key>`的具体可选值可以参考[workload group](../../../../admin-manual/workload-management/workload-group.md).
2727

28-
| 参数 | 说明 | 是否必填 |
29-
| -- | -- | -- |
30-
| `<cpu_share>` | 用于设置资源组获取 cpu 时间的多少,可以实现 cpu 资源软隔离。cpu_share 是相对值,表示正在运行的资源组可获取 cpu 资源的权重。例如,用户创建了 3 个资源组 rg-a、rg-b 和 rg-c,cpu_share 分别为 10、30、40,某一时刻 rg-a 和 rg-b 正在跑任务,而 rg-c 没有任务,此时 rg-a 可获得 (10 / (10 + 30)) = 25% 的 cpu 资源,而资源组 rg-b 可获得 75% 的 cpu 资源。如果系统只有一个资源组正在运行,则不管其 cpu_share 的值为多少,它都可以获取全部的 cpu 资源。 ||
31-
| `<memory_limit>` | 用于设置资源组可以使用 be 内存的百分比。资源组内存限制的绝对值为:`物理内存 * mem_limit * memory_limit`,其中 mem_limit 为 be 配置项。系统所有资源组的 memory_limit 总合不可超过 100%。资源组在绝大多数情况下保证组内任务可使用 memory_limit 的内存,当资源组内存使用超出该限制后,组内内存占用较大的任务可能会被 cancel 以释放超出的内存,参考 enable_memory_overcommit。 ||
32-
| `<enable_memory_overcommit>` | 用于开启资源组内存软隔离,默认为 false。如果设置为 false,则该资源组为内存硬隔离,系统检测到资源组内存使用超出限制后将立即 cancel 组内内存占用最大的若干个任务,以释放超出的内存;如果设置为 true,则该资源组为内存软隔离,如果系统有空闲内存资源则该资源组在超出 memory_limit 的限制后可继续使用系统内存,在系统总内存紧张时会 cancel 组内内存占用最大的若干个任务,释放部分超出的内存以缓解系统内存压力。建议在有资源组开启该配置时,所有资源组的 memory_limit 总和低于 100%,剩余部分用于资源组内存超发。 ||
3328

3429

3530
## 示例
@@ -39,8 +34,7 @@ PROPERTIES (
3934
```sql
4035
create workload group if not exists g1
4136
properties (
42-
"cpu_share"="10",
43-
"memory_limit"="30%",
44-
"enable_memory_overcommit"="true"
37+
"max_cpu_percent"="10%",
38+
"max_memory_percent"="30%"
4539
);
4640
```

i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md

Lines changed: 66 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,75 @@ SHOW WORKLOAD GROUPS [LIKE "<pattern>"];
2626
1. 展示所有资源组:
2727

2828
```sql
29-
mysql> show workload groups;
30-
+----------+--------+--------------------------+---------+
31-
| Id | Name | Item | Value |
32-
+----------+--------+--------------------------+---------+
33-
| 10343386 | normal | cpu_share | 10 |
34-
| 10343386 | normal | memory_limit | 30% |
35-
| 10343386 | normal | enable_memory_overcommit | true |
36-
| 10352416 | g1 | memory_limit | 20% |
37-
| 10352416 | g1 | cpu_share | 10 |
38-
+----------+--------+--------------------------+---------+
29+
mysql> show workload groups \G;
30+
*************************** 1. row ***************************
31+
Id: 1754728930516
32+
Name: normal
33+
min_cpu_percent: 20%
34+
max_cpu_percent: 30%
35+
min_memory_percent: 0%
36+
max_memory_percent: 50%
37+
max_concurrency: 1
38+
max_queue_size: 1
39+
queue_timeout: 0
40+
scan_thread_num: 16
41+
max_remote_scan_thread_num: -1
42+
min_remote_scan_thread_num: -1
43+
memory_low_watermark: 75%
44+
memory_high_watermark: 85%
45+
compute_group: default
46+
read_bytes_per_second: -1
47+
remote_read_bytes_per_second: -1
48+
slot_memory_policy: none
49+
running_query_num: 0
50+
waiting_query_num: 0
51+
*************************** 2. row ***************************
52+
Id: 1754740507946
53+
Name: test_group2
54+
min_cpu_percent: 10%
55+
max_cpu_percent: 30%
56+
min_memory_percent: 0%
57+
max_memory_percent: 3%
58+
max_concurrency: 2147483647
59+
max_queue_size: 0
60+
queue_timeout: 0
61+
scan_thread_num: -1
62+
max_remote_scan_thread_num: -1
63+
min_remote_scan_thread_num: -1
64+
memory_low_watermark: 75%
65+
memory_high_watermark: 85%
66+
compute_group: default
67+
read_bytes_per_second: -1
68+
remote_read_bytes_per_second: -1
69+
slot_memory_policy: none
70+
running_query_num: 0
71+
waiting_query_num: 0
3972
```
4073

4174
2. 使用 LIKE 模糊匹配:
4275

76+
4377
```sql
44-
mysql> show workload groups like "normal%"
45-
+----------+--------+--------------------------+---------+
46-
| Id | Name | Item | Value |
47-
+----------+--------+--------------------------+---------+
48-
| 10343386 | normal | cpu_share | 10 |
49-
| 10343386 | normal | memory_limit | 30% |
50-
| 10343386 | normal | enable_memory_overcommit | true |
51-
+----------+--------+--------------------------+---------+
78+
mysql> show workload groups like "normal%" \G;
79+
*************************** 1. row ***************************
80+
Id: 1754728930516
81+
Name: normal
82+
min_cpu_percent: 20%
83+
max_cpu_percent: 30%
84+
min_memory_percent: 0%
85+
max_memory_percent: 50%
86+
max_concurrency: 1
87+
max_queue_size: 1
88+
queue_timeout: 0
89+
scan_thread_num: 16
90+
max_remote_scan_thread_num: -1
91+
min_remote_scan_thread_num: -1
92+
memory_low_watermark: 75%
93+
memory_high_watermark: 85%
94+
compute_group: default
95+
read_bytes_per_second: -1
96+
remote_read_bytes_per_second: -1
97+
slot_memory_policy: none
98+
running_query_num: 0
99+
waiting_query_num: 0
52100
```

0 commit comments

Comments
 (0)