starrocks/starrocks-debug-skills/cpu-saturation
Claude Code and agent skill by starrocks/starrocks-debug-skills
- community
Checking that the SKILL.md file is still in the repository.
Use as the first stop when a BE or FE host shows high CPU (elevated load average or top near 100%). Attributes CPU to the right workload — query pipeline, import flush/compression, compaction threads, background tasks, FE GC, or non-StarRocks processes — then hands off to the appropriate deep-dive skill (query/import/compaction/node). Does not resolve root causes directly; acts as a triage and attribution layer.
Install
npx vskill@latest install starrocks/starrocks-debug-skills/cpu-saturationSKILL.md
CPU Saturation Triage
Investigation guide for BE or machine CPU saturation. This skill focuses on attribution: which process, which module, and which workload is consuming CPU. After attribution, follow the referenced deep-dive skill for root-cause analysis.
Metric Taxonomy — Read This First
Before using the decision tree, establish what the CPU is doing and which process owns it.
OS-level CPU indicators
| Metric | Meaning | |
|---|---|---|
us (user) in top | User-space CPU — StarRocks computation, compression | |
sy (system) in top | Kernel CPU — system calls, IO, interrupts; high sy with us suggests thread overhead | |
wa (iowait) in top | CPU waiting for disk IO — not CPU saturation, disk bottleneck | |
st (steal) in top | CPU stolen by hypervisor (VM environments only) — noisy neighbor | |
| Load average | Running + runnable threads; >vCPU count indicates oversubscription |
How to retrieve:
BE-level CPU classification metrics (v3.4+)
| Metric | Meaning | |
|---|---|---|
starrocks_be_cpu_task_query | CPU time consumed by query pipeline threads | |
starrocks_be_cpu_task_load | CPU time consumed by import/flush threads | |
starrocks_be_cpu_task_compaction | CPU time consumed by compaction threads | |
starrocks_be_cpu_task_clone | CPU time consumed by tablet clone (rebalance) |
How to retrieve:
FE-level CPU indicators
| Metric / Observable | Meaning | |
|---|---|---|
java process CPU in top | FE planning storm or GC pressure | |
GC CPU ratio from fe.gc.log | High GC CPU (>30% of elapsed) indicates heap pressure | |
jstack — many RUNNABLE threads in optimizer code | Query planning CPU storm |
How to retrieve:
Function-level CPU attribution
| Hot function prefix | Likely module | |
|---|---|---|
starrocks::pipeline:: | Query pipeline executor | |
starrocks::vectorized:: | Vectorized evaluation (scan / aggregate / join) | |
starrocks::MemTable:: | Import memtable flush | |
starrocks::Compaction:: | Compaction | |
starrocks::SegmentWriter:: | Import segment write | |
starrocks::lake:: | Shared-data operations | |
snappy:: / lz4:: / zstd:: | Compression (flush or compaction) | |
tcmalloc:: / malloc | Memory allocator contention | |
starrocks::SchemaChange | Schema change task | |
starrocks::clone | Tablet clone (rebalance) |
How to retrieve:
Key rules for interpretation:
- High
wa(iowait) is NOT CPU saturation — it means CPU is idle waiting for disk. Diagnose withiostat -x 1, then follow compaction/SKILL.md or import/SKILL.md. starrocks_be_cpu_task_*metrics are available only in v3.4+. On older versions, useperf toporpidstatfor function-level attribution.- If ALL metrics degrade simultaneously (query + import + compaction), suspect a non-StarRocks process or hypervisor steal (
st> 0) rather than a StarRocks-internal cause. - BE CPU metrics are per-BE — always identify the hotspot node first before applying cluster-wide changes.
- FE GC CPU exceeding 30% of elapsed wall time is a separate problem from BE CPU saturation and requires heap/GC tuning, not thread reduction.
CPU Saturation Signal Reference
| Observation combination | Most likely root cause | First checkpoint | |
|---|---|---|---|
us high; query latency up; import and compaction normal | Query-caused (Section 3a) | SHOW PROC '/current_queries'; perf top shows vectorized:: | |
us high; import latency up; perf top shows MemTable:: / snappy:: | Import compression CPU (Section 3b) | starrocks_be_cpu_task_load metric | |
us high; compaction score dropping; query slow; perf top shows Compaction:: | Compaction over-provisioned (Section 3c) | starrocks_be_cpu_task_compaction; reduce threads | |
ALL metrics degrade simultaneously; st > 0 in VM or non-StarRocks process in top | Non-StarRocks process or hypervisor steal (Section 5) | ps aux --sort=-%cpu; top %st | |
java process CPU high; FE queries stuck in Planning | FE planning storm or GC (Section 4) | jstack + top -Hp; fe.gc.log | |
wa (iowait) high; us normal | IO bottleneck, not CPU | iostat -x 1; see compaction/SKILL.md | |
sy high; many threads in top -Hp | Thread scheduling overhead | Reduce pipeline_dop or compaction thread count | |
starrocks_be_cpu_task_clone elevated | Tablet rebalance consuming CPU | SHOW PROC '/cluster_balance'; throttle clone |
Triage Decision Tree
1. Which Process Owns the CPU?
| Observation | Next Step | |
|---|---|---|
starrocks_be is top consumer | Section 2 | |
java (FE) is top consumer | Section 4 | |
| Other process (mysqld, rsync, python...) | Section 5 | |
kworker / ksoftirqd / kernel threads | Network interrupt or disk IRQ — check sar -I ALL, iostat | |
CPU wa (iowait) is high, not us | IO bottleneck, not CPU — see compaction/SKILL.md or import/SKILL.md |
2. Which BE Module?
Step 2a: Quick workload inventory
Step 2b: v3.4+ per-task-type CPU metrics
Key metrics:
starrocks_be_cpu_task_query— query pipeline CPUstarrocks_be_cpu_task_load— import write CPUstarrocks_be_cpu_task_compaction— compaction CPUstarrocks_be_cpu_task_clone— tablet clone CPU
Step 2c: perf top (function-level attribution)
3a. Query-Caused CPU Saturation
Confirm signals:
starrocks_be_cpu_task_queryis the dominant rising metricperf topshowsstarrocks::pipeline::orstarrocks::vectorized::as hot functionsSHOW PROC '/current_queries'shows active queries with highScanRowsorMemUsageBytes
Mechanism: Query pipeline threads consume CPU proportional to data volume and operator complexity. Full-table scans (no predicate pushdown), large hash joins (hash table exceeds CPU cache), and high-cardinality aggregations all create sustained CPU pressure. Without resource group limits, a single large query can saturate all cores.
Identify the Culprit SQL
Profile the Query
Common query CPU causes:
| Symptom in Profile | Cause | Fix | |
|---|---|---|---|
HASH_JOIN_NODE dominates CPU | Large hash table probe | Force [SHUFFLE]; collect statistics | |
AGGREGATE_NODE dominates | High-cardinality aggregation | Check streaming pre-agg; add pre-filter | |
OLAP_SCAN_NODE CPU high, BytesRead huge | Full scan, no pushdown | Fix predicate type mismatch; add index | |
| Many pipeline threads near 100% | Too many concurrent heavy queries | Add resource group; set query_mem_limit |
→ Deep-dive: [query/SKILL.md](../query/SKILL.md)
3b. Import-Caused CPU Saturation
Confirm signals:
starrocks_be_cpu_task_loadis the dominant elevated metricperf topshowsstarrocks::MemTable::,starrocks::SegmentWriter::,snappy::, orzstd::as hot functions- Active imports visible via
information_schema.loads
Mechanism: Import flush compresses memtable data before writing to disk segments. Compression (especially zstd) is CPU-intensive. With many concurrent stream loads, flush threads saturate available cores. Query pipeline threads then compete for CPU time slices, causing query latency to rise even without any change in query patterns.
Identify the Import Load
Common import CPU causes:
| Observation | Cause | Fix | |
|---|---|---|---|
| Many concurrent stream loads | Memtable flush compression saturating cores | Reduce concurrency; use lz4 instead of zstd for memtable | |
flush_thread_num_per_store threads all busy | Flush threads competing with query | Balance flush_thread_num_per_store vs query concurrency | |
perf top shows snappy:: or zstd:: hot | Compression CPU during flush | Tune compression_type for the table | |
| Import CPU high, query CPU also high | Both competing for CPU | Use resource groups to cap import CPU |
→ Deep-dive: [import/SKILL.md](../import/SKILL.md)
3c. Compaction-Caused CPU Saturation
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 repositoryCheckingcpu-saturation/SKILL.md
Popularity
- Repository stars
- 78
- Repository forks
- 14
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. 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/cpu-saturation)