Lý Thành
03/05/2026, 4:17 AMRocky
03/05/2026, 4:17 AMuser1 and 20% to user2, you can follow this pattern:
1. Enable Resource Groups
First, ensure the resource group feature is enabled (it is usually enabled by default in recent versions):
sql
SET GLOBAL enable_resource_group = true;
2. Create Resource Groups for your users
You can define limits using properties like cpu_core_limit and mem_limit.
sql
-- Resource Group for user1 (10% target)
CREATE RESOURCE GROUP rg_user1
PROPERTIES (
"cpu_core_limit" = "2", -- Example core limit
"mem_limit" = "0.1", -- 10% of the total BE memory
"type" = "normal"
);
-- Resource Group for user2 (20% target)
CREATE RESOURCE GROUP rg_user2
PROPERTIES (
"cpu_core_limit" = "4", -- Example core limit
"mem_limit" = "0.2", -- 20% of the total BE memory
"type" = "normal"
);
3. Bind Users to the Groups (Classifiers)
You use Classifiers to tell StarRocks which user belongs to which group:
sql
-- Map user1 to rg_user1
ALTER RESOURCE GROUP rg_user1 ADD CLASSIFIER (user='user1');
-- Map user2 to rg_user2
ALTER RESOURCE GROUP rg_user2 ADD CLASSIFIER (user='user2');
Key Parameters:
* mem_limit: The percentage of memory (from 0.0 to 1.0) that this group can use on each Backend (BE).
* cpu_core_limit: The maximum number of CPU cores this group can use.
* concurrency_limit: You can also limit the number of concurrent queries for that user to prevent system overload.
This setup ensures that user1 and user2 stay within their allocated "lane," providing great multi-tenant stability! Let me know if you need help with the specific syntax for your version of StarRocks.Lý Thành
03/05/2026, 4:22 AMLý Thành
03/05/2026, 4:22 AMRocky
03/05/2026, 4:23 AMenable_resource_group is not recognized by your StarRocks cluster.
This error typically happens for one of two reasons related to the version of StarRocks you are using:
1. You are using StarRocks 3.0 or later
Starting from StarRocks 3.0, the "Resource Group" feature was evolved and replaced by Workload Management (Workload Groups). The variable enable_resource_group is no longer used in these versions.
* To enable Workload Management: Use the variable enable_workload_group instead.
sql
SET GLOBAL enable_workload_group = true;
* To specify a group for your session: Use the variable workload_group.
sql
SET workload_group = 'your_group_name';
2. You are using a version earlier than 2.2
The Resource Group feature was introduced in StarRocks v2.2. If you are on a very old version, this variable will not exist.
──────────
Recommended Actions:
1. Check your StarRocks version:
Run the following command to see which version you are running:
sql
SELECT VERSION();
2. Use Workload Groups (for v3.0+):
If you are on version 3.x, I recommend looking into the Workload Group documentation. You can create a group like this:
sql
CREATE WORKLOAD GROUP IF NOT EXISTS big_query_group
PROPERTIES (
"cpu_share" = "10",
"mem_limit" = "20%"
);
Then assign your session to it:
sql
SET workload_group = 'big_query_group';
3. Check for typos:
Ensure there isn't a small typo in the variable name, though the error message suggests it is completely missing from your current version's variable list.
If you are trying to follow a specific tutorial or documentation, it might be for an older version of StarRocks. Let me know which version you are on, and I can give you the exact commands for that version!