用途:排查 Apache Doris 的慢查询、挂起查询和超时查询,按原因分类定位问题。
主要能力:资料将原因分为四类。A 客户端超时过小,对比 query_timeout 与 Profile wall;B 规划器问题,Nereids 耗时过长或 nereids_timeout_second;C BE 计算(scan/join/spill),看 Profile 的 active ExecTime;D Exchange / brpc 问题,表现为 WaitForData 接近超时、exchange 时 failed to send brpc、:8060 上出现 [E1008]。
使用方式:先 SET enable_profile = true; 复现问题,再用脚本排查,例如 ./scripts/doris-debug log-grep fe/log be/log --query-id "$QID" --pack planner、./scripts/doris-debug log-grep be/log --query-id "$QID" --pack exchange、./scripts/doris-debug audit-topk fe/log/fe.audit.log -k 20 --min-ms 5000。规划器缓解(仅会话级):SET disable_join_reorder=true; 用于宽 ETL join,并用 ANALYZE 修正统计信息。
原因 C 处理:若 Profile 显示高 active ExecTime(非 Wait*),可路由到 doris-profile-reader 做深度分析,传入各算子 ActiveTime、scan 的 RowsRead/ScanBytes、SpillDataSize、JoinType 与 JoinRows。无该技能时可直接 curl -s "http://$FE:8030/api/query_profile?query_id=$QID" 获取 Profile 文本,关注 ScannerGetBlockTime、SpillDataSize、JoinProbeTime、RowsRead/ScanBytes 等计数器。
原因 D 处理:curl -s "http://$BE:8040/api/reset_rpc_channel/all" 可清理 brpc_internal_client_cache;be.conf 中 enable_brpc_connection_check 默认 false,可设为 true 并配合 brpc_connection_check_timeout_ms = 10000,静态 DEFINE_Bool 需重启生效。不要只依赖 ICMP,需检查 priority_networks。
限制:资料未提供安装方式、收费信息与完整使用步骤,部分阈值与判断需结合实际环境确认。