Phước Hồ
06/24/2026, 12:15 PMRocky
06/24/2026, 12:16 PMCREATE RESOURCE GROUP statement. You must define a user classifier and set the concurrency_limit.
sql
CREATE RESOURCE GROUP user_a_group
TO
(user='user_a') -- Matches queries from user_a
WITH (
"concurrency_limit" = "10", -- Max 10 concurrent queries for this user
"cpu_weight" = "10",
"mem_limit" = "20%"
);
2. How Queuing Works:
When the number of concurrent queries from user_a exceeds the concurrency_limit (10 in the example above), any additional queries from that user will automatically be placed in a queue instead of failing.
3. Configure Global Queue Behavior (Optional):
You can control how the queue behaves (e.g., how many queries can wait and for how long) using global session variables:
* `query_queue_max_queued_queries`: The maximum number of queries that can be in the queue before new ones are rejected (default: 1024).
* `query_queue_pending_timeout_second`: How long a query can wait in the queue before timing out (default: 300s).
Key Version Details
* v3.1.4 and later: Support for concurrency_limit within a resource group is fully optimized and managed by the Leader FE to ensure accurate queuing even during sudden traffic spikes.
* Prior to v3.1.4: Resource groups were primarily used for CPU/Memory isolation. Global concurrency limits existed, but per-group queuing was less robust.
Summary of Properties
Property | Description
concurrency_limit | The maximum number of concurrent queries allowed for the resource group (and thus the user).
user (Classifier) | Binds the resource group's limits to a specific StarRocks user.
References
• sql-reference/sql-statements/cluster-management/resource_group/CREATE_RESOURCE_GROUP.md
• administration/management/resource_management/resource_group.md