<@U0A71G31CDV> what configs should I consider to e...
# questions-and-troubleshooting
m
@Rocky what configs should I consider to enable query queues, I have resource groups with specific concurrency, after it reaches concurrency, would like to queue it
r
To enable query queuing for your resource groups, you need to configure specific global session variables and resource group properties. Note that resource group-level queuing is officially supported from v3.1.4 onwards. 1. Enable Query Queuing By default, query queues are disabled. You must enable them globally for the types of queries you want to queue:
Copy code
sql
-- 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.
Copy code
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:
Copy code
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