starrocks/starrocks-debug-skills/resource-isolation
Claude Code and agent skill by starrocks/starrocks-debug-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when setting up or troubleshooting resource groups, query queues, or big-query circuit breakers — or when a runaway query is starving other workloads. Covers resource group classifier mismatches (queries falling to default_wg), CPU/memory/scan limit calibration from audit log percentiles, SQL blacklist patterns, query queue full rejection errors, and emergency statistics collection disable when BRPC is saturated.
Install
npx vskill@latest install starrocks/starrocks-debug-skills/resource-isolationSKILL.md
Resource Isolation, Query Queue, and Query Governance
Investigation guide for resource groups, query queues, big-query circuit breakers, and SQL blacklisting.
Five root causes account for most resource isolation issues:
- Cause A — Unclassified queries monopolize resources (fall into
default_wg) - Cause B — Memory limit too tight causing disk spill and IO contention
- Cause C — Queue full causing immediate rejection (misleading error to client)
- Cause D — Big query unbounded for a specific user (no
big_query_*limits set) - Cause E — Statistics collection saturating BRPC worker threads
Metric Taxonomy — Read This First
Before diagnosing, understand the observable signals for resource isolation issues.
FE metrics
| Metric | Meaning | |
|---|---|---|
starrocks_fe_query_resource_group | Query count per resource group — which groups are being used | |
starrocks_fe_query_resource_group_latency | Percentile latencies per group — which groups have high P99 | |
starrocks_fe_query_resource_group_err | Error count per group — which groups are rejecting queries |
How to retrieve:
BE metrics
| Metric | Meaning | |
|---|---|---|
starrocks_be_resource_group_cpu_limit_ratio | CPU allocation ratio per group per BE node | |
starrocks_be_resource_group_mem_limit_bytes | Memory limit in bytes per group per BE node |
How to retrieve:
Query queue metrics
| Metric / Observable | Meaning | |
|---|---|---|
query_queue_mem_used_pct_limit | Memory usage threshold that triggers queuing | |
| Queue depth in FE metrics | How many queries are currently waiting | |
FE log query rejected: queue is full | Queue at capacity — new queries rejected immediately |
How to retrieve:
Audit log signals
| Field | Meaning | |
|---|---|---|
resource_group | Which resource group the query was classified into | |
cpuCostNs | Total CPU cost in nanoseconds — use for cpu_core_limit tuning | |
memCostBytes | Peak memory — use for big_query_mem_limit tuning | |
scanRows | Rows scanned — use for big_query_scan_rows_limit tuning |
How to retrieve:
Key rules for interpretation:
- CPU limit in resource groups is soft (proportional sharing when contended); memory limit is hard (query fails immediately when exceeded). Tune memory limits conservatively to avoid false kills.
- Queries classified into
default_wghave no effective CPU or memory limits —default_wgcannot be altered. If queries fall here, add a classifier. starrocks_fe_query_resource_group_errcounts both hard memory kills and queue rejections — drill into FE log to distinguish.- Resource group settings are per-BE —
mem_limit = 30%means 30% of each individual BE's memory, not 30% of the cluster total.
Resource Isolation Issue Reference
| Symptom | Root cause | Quick confirm | ||
|---|---|---|---|---|
Queries fall into default_wg; no resource classification | No classifier matches the query | `grep "resource_group=default_wg" fe.audit.log \ | wc -l` | |
Memory limit exceeded error but CPU is fine | mem_limit too tight for operator peak | Check memCostBytes P99 in audit vs mem_limit setting | ||
| Queries rejected immediately (not after timeout) | Queue full — max_queued_queries reached | `grep "queue is full" fe.log \ | tail -5` | |
| Big query runs for hours; no circuit breaker fires | No big_query_* limits on resource group | SHOW RESOURCE GROUPS — check big_query_* fields | ||
| All queries slow; BRPC thread pool saturated | Statistics collection flooding BRPC | grep "rpc.*stat" fe.log — check case-002 pattern | ||
| Small queries starve during large analytical query | Unclassified large query in default_wg | SHOW PROC '/current_queries' — look for no resource_group | ||
| Spilling query causes collateral IO slowdown | mem_limit too low; disk spill on shared drive | BE disk await time high; spill dir same as data dir |
Phase 1 — Identify the Issue
Step 1.1 — Check query classification
Step 1.2 — Check for memory limit kills and queue rejections
Step 1.3 — Check statistics collection saturation
Issue signal → Cause mapping:
| Pattern | Points toward | |
|---|---|---|
High default_wg query ratio | Cause A — unclassified queries | |
Memory limit exceeded on specific resource group | Cause B — mem_limit too tight | |
queue is full in FE log; immediate client rejection | Cause C — queue full | |
| Queries from one user running for hours; no kill | Cause D — unbounded big query | |
| BRPC failures correlated with statistics collection schedule | Cause E — stats collection saturation |
Phase 2 — Measure Current State
Step 2.1 — List all resource groups and their configuration
Step 2.2 — Measure actual resource usage from audit log
Phase 3 — Take Action by Cause
Cause A — Unclassified Queries Monopolize Resources
Confirm all match:
- High fraction of queries in
fe.audit.logshowresource_group=default_wg SHOW PROC '/current_queries'shows queries with no resource group ordefault_wg- Small queries starve when large queries run
Mechanism: Queries that match no classifier are assigned to default_wg, which has no configurable CPU or memory limits. A single large analytical query in default_wg consumes all available BE CPU and memory, starving smaller concurrent queries. default_wg cannot be modified — the fix is to create classifiers that capture all query patterns.
Actions:
→ Go to Phase 4: Verify Recovery
Cause B — Memory Limit Too Tight Causing Disk Spill
Confirm all match:
- BE log shows
query spill to diskorMemTracker exceed limit - Disk await time high on BE hosts during affected queries
- Spill directory is on the same disk as data storage
Mechanism: Resource group memory limits are hard limits — when a query's operator (sort buffer, hash table) exceeds the group's mem_limit, it spills intermediate data to disk. If the spill directory shares a disk with tablet data storage, compaction, and scan operations, IO contention degrades all queries on that BE. Multiple concurrent spilling queries compound the effect.
Actions:
→ Go to Phase 4: Verify Recovery
Cause C — Queue Full Causing Immediate Rejection
Confirm all match:
- FE log shows
query rejected: queue is full - Client receives immediate connection error (not after a wait timeout)
query_queue_max_queued_queriesis reached during burst traffic
Mechanism: When a resource group reaches concurrency_limit, subsequent queries enter the queue. When query_queue_max_queued_queries is reached, additional queries are rejected immediately with an error — not after a timeout. Clients without retry logic interpret this as a cluster crash rather than resource exhaustion. The error message may appear as a generic connection error at the application layer.
Actions:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingresource-isolation/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/starrocks/starrocks-debug-skills/resource-isolation)