[Enhancement] Arrow Stream Load decompresses record batches on Arrow's global thread pool
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 be/src/format/arrow/arrow_stream_reader.cpp 开始,这里使用 arrow::ipc::IpcReadOptions::Defaults() 读取 Stream Load 的请求体,并检查其中 use_threads 是如何设置的。同样的模式也出现在 arrow_flight_batch_reader.cpp 中。完成的标准是:Stream Load 读取路径在 scanner 线程上进行解压(可选地置于一个 BE 配置之后),现有的 Arrow 导入测试全部通过,并且吞吐量的变化已通过基准测试确认。
由索引模型根据 Issue 内容生成。
描述
Search before asking
- I had searched in the issues and found no similar issues.
Description
ArrowStreamReader reads Stream Load bodies with arrow::ipc::IpcReadOptions::Defaults() (be/src/format/arrow/arrow_stream_reader.cpp, master too), and that leaves use_threads = true. For compressed IPC streams (ZSTD/LZ4 record batches), Arrow then decompresses every record batch's buffers on Arrow's single process-wide CPU thread pool, not on the scanner thread doing the read.
Under many concurrent Arrow loads, scanner threads mostly wait on that one pool's mutex and condition variable. Off-CPU stacks show around 75 scanner threads per BE parked in pthread_cond_signal / arrow::internal::ThreadPool::SpawnReal, while the BE stays well below CPU saturation.
Measurements
4 BEs (192 vCPU each, arm64), cloud mode, many concurrent Stream Loads, ZSTD-compressed Arrow record batches:
- default
IpcReadOptions(global pool): plateau of about 5.7M rows/s total, BEs at about 64% CPU; - the same data sent uncompressed: about 7.1M rows/s;
- ZSTD, with decompression inline on the scanner thread (
use_threads = false): 8.15–8.45M rows/s.
Solution
Read Stream Load bodies with use_threads = false (optionally behind a BE config), so decompression runs on the scanner thread that already owns the load. Load concurrency comes from the scanner pool, so Arrow's internal pool adds only contention. arrow_flight_batch_reader.cpp uses the same pattern and may benefit too.
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要语言
- Java
- 星标
- 16.2k
- 派生
- 4k
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 660
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/doris 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
[Bug] array_sort's second comparator argument takes the first argument's name: a nested lambda reads the wrong argument, and alias functions sort nothing可能已有人在做 @adarshomrey 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
[Bug]: NetworkPolicyOperator removes finalizers added by the EKS network policy controller, which adds them back可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug needs-triage
难度 2/5 1-3 小时 新手友好度 82/100
strimzi/strimzi-kafka-operator#13360 · 5 条评论 ·
维护者通常 1 天内回复
-
bug javascript
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
NationalSecurityAgency/ghidra#10149 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 90/100
yegor256/antlr2ebnf-maven-plugin#155 ·
维护者通常 1 天内回复