Mohan
09/07/2026, 6:40 AMRocky
09/07/2026, 6:41 AMsql
-- Enable for SELECT queries
SET GLOBAL enable_query_queue_select = true;
-- Enable for INSERT/loading tasks
SET GLOBAL enable_query_queue_load = true;
-- Enable resource group-level queuing (Required for v3.1.4+)
SET GLOBAL enable_group_level_query_queue = true;
2. Set Resource Group Concurrency
You define the concurrency threshold within the resource group itself. When a query exceeds this limit, it will be placed in the queue rather than failing immediately.
sql
ALTER RESOURCE GROUP your_group_name WITH (
"concurrency_limit" = 10
);
* concurrency_limit: The maximum number of concurrent queries for this group.
3. Configure Queue Capacity and Timeouts
These global variables control the behavior of the queue once it is triggered. If these limits are reached, incoming queries will be rejected.
Variable | Default | Description
query_queue_max_queued_queries | 1024 | The maximum number of queries allowed to wait in the queue.
query_queue_pending_timeout_second | 300 | The maximum time (in seconds) a query can stay in the queue before timing out.
4. Important Version Differences
* v3.1.4 and later: StarRocks uses "Collective Concurrency Management." The Leader FE manages the concurrency limits cluster-wide, which prevents sudden bursts from bypassing the limits and provides more accurate queuing.
* Before v3.1.4: Queuing was primarily global. Resource group concurrency_limit was enforced by individual BEs based on periodic reporting, which could lead to brief periods of exceeding the limit before the FE was notified.
Monitoring
You can monitor the queue status using the following command:
sql
SHOW USAGE RESOURCE GROUPS;
Look for metrics such as PendingQueries and QueuedQueries to see how many queries are currently waiting.
References
• faq/resource_isolation_faq.md
• administration/management/resource_management/query_queues.md