Optimize S3 Bandwidth Usage via Two-Phase Progressive Leaf Search for Heavy Queries
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- rust
- 领域
- backend, cloud, performance, search
调研方向
从 leaf.rs 中的 single_doc_mapping_leaf_search 开始,跟踪 run_local_search_tasks,然后阅读 SearcherConfig、optimize_split_order、CanSplitDoBetter 和 simplify_search_request。当大型 split 集合使用可配置的优先级批次、0 保留当前行为、较小的查询仍保持并发,并且 CountAll/count-only 行为保持正确时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Description of the Problem
When executing a search query that hits a massive number of splits (e.g., in a 50PB log scale deployment with a broad time range and weak filters), Quickwit exhibits extremely heavy continuous reads from S3. This pattern can saturate the network ingress bandwidth on the search nodes.
Upon analyzing the S3 access pattern (s3_compatible_storage.rs, bundle_storage.rs, and SplitCache), it's clear that Quickwit is already highly optimized (utilizing HTTP Range Requests efficiently). The problem stems from the concurrency logic in the leaf.rs module.
Currently, in single_doc_mapping_leaf_search, all matched uncached splits are scheduled and dispatched concurrently via run_local_search_tasks.
While Quickwit has a great CanSplitDoBetter pruning mechanism, it has limited effectiveness in this extreme scenario. Because hundreds or thousands of splits are spawned and enter their warmup phase (triggering S3 I/O) almost simultaneously, the pruning state (worst_hit_found) doesn't get populated fast enough to prevent unnecessary splits from aggressively downloading their fast_fields and dictionary terms.
As a result, an enormous amount of unnecessary S3 Range Request bandwidth is wasted on splits that would have been pruned anyway if they were processed slightly later.
Proposed Solution: Progressive Two-Phase Search
To maximize the power of the existing CanSplitDoBetter mechanism without impacting normal query latency (where split_count is reasonable), we propose modifying single_doc_mapping_leaf_search to implement a "Two-Phase" or "Progressive" execution path when the split count is large.
Logic implementation:
- New Configuration: Introduce
progressive_search_batch_size: usizeinSearcherConfig(defaulting to 20 or similar). If set to 0, it falls back to the current behavior. - Phase 1 (Priority Batch): In
leaf.rs, we take the firstbatch_sizesplits (which are already sorted byoptimize_split_order, meaning they are highly relevant) and execute them. Wetokio::join!them and wait for completion. - Data Population: Upon Phase 1 completion, the
CanSplitDoBetterstructure (which holds theincremental_merge_collector) is filled with concreteworst_hitscores from the most relevant splits. - Phase 2 (Remaining Splits): We then dispatch the remaining splits. Because
CanSplitDoBetteris now populated with a strong baseline, thesimplify_search_requestfunction can aggressively convert unnecessary splits into count-only queries or completely skip them (ifcountis not needed), preventing them from making any heavy S3 I/O requests.
Impact & Safety:
- Paginating (
countaccuracy) remains unaffected.simplify_search_requestcorrectly respectsCountAlland safely converts splits tocount-only(bypassing expensive field data downloads) instead of dropping them. - This effectively bounds the peak S3 GET request burst length to exactly what is needed for the Top-K.
- It degrades seamlessly back to the original concurrency behavior if the query matches fewer than
progressive_search_batch_sizesplits.
Environment details:
- OS: Linux / Kubernetes
- Quickwit Version: Latest
main
- 主要语言
- Rust
- 星标
- 11.8k
- 派生
- 628
- 平均合并
- 2 天 22 小时
- 30 天内合并 PR
- 50
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quickwit-oss/quickwit 的其他 Issue
-
area:otel documentation
难度 2/5 1-3 小时 新手友好度 68/100
quickwit-oss/quickwit#6686 ·
维护者通常 1 天内回复
-
Add some examples of requests in the REST API reference docs可能已有人在做 @Cunninger 于 88 天前认领。 未关闭enhancement good first issue
难度 2/5 1-3 小时 新手友好度 78/100
quickwit-oss/quickwit#4266 · 1 条评论 ·
维护者通常 1 天内回复
-
documentation
难度 1/5 1 小时以内 新手友好度 65/100
quickwit-oss/quickwit#3872 ·
维护者通常 1 天内回复
-
documentation
难度 1/5 1 小时以内 新手友好度 65/100
quickwit-oss/quickwit#3666 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
quickwit-oss/quickwit#2769 ·
维护者通常 1 天内回复
查看 quickwit-oss/quickwit 的全部 Issue
相似的 Issue
-
[M09] Silence parser misreads ffmpeg times in scientific notation (6.25e-05 → 6.25 s)可能已有人在做 @G-darshan-32 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
clipy-recorder/clipy#164 · 1 条评论 ·
-
p2 ready-mac
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
quickwit-oss/tantivy#3299 ·
维护者通常 1 天内回复
-
P2
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
`stream enable` fails with "already enabled" on every fresh session since streaming became always-on未关闭
难度 2/5 1-3 小时 新手友好度 70/100
vercel-labs/agent-browser#2797 ·
维护者通常 1 天内回复