Doris 资源隔离调试
doris-debug-resource-isolation
用于 Doris Workload Group / 资源标签队列饥饿、CPU/内存隔离泄漏以及工作负载策略调试。命令:SHOW WORKLOAD GROUPS、EXPLAIN resource。
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 50
- Forks
- 15
01 前言 Front Matter
- name
- doris-debug-resource-isolation
- version
- 0.2.0
- category
- resource-isolation
- description
- Use for Doris Workload Group / resource tag queue starvation, CPU/memory isolation leaks, and workload policy debugging. Commands: SHOW WORKLOAD GROUPS, EXPLAIN resource.
02 资源文件 1
03 SKILL.md 正文
Resource Isolation (Workload Group)
Causes
| ID | Cause | Evidence | Source anchor |
|---|---|---|---|
| A | Queue starvation | Queries queued in SHOW WORKLOAD GROUPS; QueueTime growing |
WorkloadGroupMgr.java |
| B | CPU oversubscription | One WG consuming >90% CPU despite limits | CgroupCpuCtl.cpp |
| C | Memory leak across groups | MemTracker shows one WG exceeding memory_limit |
WorkloadGroupMemMgr.cpp |
| D | Tag routing wrong | Query hits wrong BE set; ResourceTag mismatch | ResourceTag.java, Tag.java |
| E | WG not active / cgroup missing | CREATE WORKLOAD GROUP had no effect |
WorkloadGroupMgr.cpp cgroup init |
10 min triage
-- Workload group status
SHOW WORKLOAD GROUPS\G
-- Check columns: Id, Name, ActiveQueries, QueuedQueries, CpuShares, MemoryLimit
-- Which WG is my query in?
SELECT * FROM information_schema.workload_group_resource_usage;
-- Workload policies (routing rules)
SHOW WORKLOAD POLICY\G
# BE cgroup inspection
cat /sys/fs/cgroup/cpu/doris/<wg_id>/cpu.shares
cat /sys/fs/cgroup/memory/doris/<wg_id>/memory.limit_in_bytes
./scripts/doris-debug be-metrics --be http://$BE:8040 --grep "workload_group"
Cause A — Queue starvation
-- See who's queued
SHOW WORKLOAD GROUPS\G
-- Raise queue concurrency
ALTER WORKLOAD GROUP etl_wg SET (
"max_concurrency" = "8",
"max_queue_size" = "100",
"queue_timeout" = "300"
);
Check be/src/pipeline/task_scheduler.cpp — the pipeline scheduler respects cgroup shares; if a high-share WG starves a low-share one, the low-share WG's queue backs up.
Cause B — CPU oversubscription
-- Create a hard CPU cap
ALTER WORKLOAD GROUP report_wg SET (
"cpu_share" = "1024",
"cpu_hard_limit" = "200%" -- 2 cores max
);
-- Force query into specific WG
SET workload_group = 'report_wg';
cgroup v1 vs v2 behavior differs. Confirm which is active on BE hosts:
mount | grep cgroup
ls /sys/fs/cgroup/cpu/doris/ # cgroup v1
ls /sys/fs/cgroup/doris/ # cgroup v2
Cause D — Tag routing
-- Check BE tags
SHOW BACKENDS\G -- look at Tag column
-- Check WG tag constraint
SHOW WORKLOAD GROUPS\G -- look at ResourceTag
If a workload group specifies a tag but no BEs carry that tag, queries queue forever. Fix:
ALTER SYSTEM MODIFY BACKEND "host:9050" SET ("tag.tag.location" = "high_mem");
Enabling cgroup on BE
# be.conf
doris_cgroup_cpu_path = /sys/fs/cgroup/cpu/doris
enable_workload_group = true
Without cgroup configured, cpu_share is a cooperative hint, not a hard guarantee.
Source
be/src/common/config.cpp—enable_workload_group, cgroup pathsbe/src/pipeline/task_scheduler.cpp— pipeline schedulingfe/.../workloadgroup/WorkloadGroupMgr.java— WG lifecyclefe/.../resource/Tag.java— resource tagsbe/src/util/cgroup_util.cpp— cgroup v1/v2 adapter
04 同仓库更多 Skills
doris-pr-description
Write, rewrite, or check the title and description of an Apache Doris pull request against the Doris PR standard. Takes the facts from the handoff file that development left when there is one, and collects them from the diff, commits, linked issue, and existing tests otherwise; classifies the PR type, fills that type's required fields, drafts the issue a Feature needs, validates the draft with a bundled checker, and creates or updates the PR on GitHub only after the user confirms. Use whenever the user wants to open, create, submit, or update a Doris PR; write, fix, or improve a PR title or description; prepare a branch for review; rewrite an existing PR's description for comparison; or check whether a description meets the standard. Also use for short requests in any language, such as "open a PR", "write the PR description", or "is this PR description good enough?", even when the standard is not mentioned.
develop-with-evidence
暂无简介
Doris PR 代码审查
doris-repo-review
从本地 clone 审查 Apache Doris PR,使用与 CI Code Review Runner 相同的多智能体、共享账本收敛工作流。当用户提供一个 PR 给 `/doris-repo-review`、要求在本地审查 Doris PR,或要求 CI 风格的审查流程时使用。安全地仅将当前 worktree 对齐到确切的 PR head,拒绝干扰已跟踪的本地更改,编写对等的英文和中文审查文档并附带经过验证的路径行锚点,绝不构建、测试或编辑源码。只有在明确选择合格审查者并使用受支持的 effort(xhigh 或 max,Codex 另支持 ultra)时,才将审查视为等同流水线;Codex 上优先 GPT-6 Astra,Claude Code 上优先 Fable 5.1。在收敛出 APPROVE 结果后,自动发布一条绑定到被审查 commit 的机器可读 PASS 评论。
Doris 查询 Profile 性能分析
doris-profile-reader
解读 Apache Doris 查询运行时 profile,尤其包括 profile 瓶颈分诊、误导性等待计数器、每算子指标优先级、扫描、join 顺序/运行时过滤分析,以及基于证据的性能解释。当给定 Doris profile、query id、profile URL/文本,或要求解释 Doris 查询性能时使用。
Doris Tablet 故障诊断
doris-debug-tablet
用于 Doris tablet/副本健康、版本倾斜、克隆积压、磁盘均衡以及 tablet 修复。命令:SHOW PROC tablet_health、SHOW TABLET、ADMIN REPAIR。
Doris 慢查询故障排查
doris-debug-query
用于排查 Apache Doris 的慢查询、挂起或超时查询。涵盖 FE 规划器(Nereids 超时)、BE Profile 瓶颈,以及端口 8060 上的 Exchange WaitForData / brpc E1008。会话变量:enable_profile、query_timeout、nereids_timeout_second。