Optimize S3 Bandwidth Usage via Two-Phase Progressive Leaf Search for Heavy Queries
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- rust
- Ambito
- backend, cloud, performance, search
Direzione di ricerca
Inizia in leaf.rs, in single_doc_mapping_leaf_search, e segui run_local_search_tasks; poi leggi SearcherConfig, optimize_split_order, CanSplitDoBetter e simplify_search_request. Il lavoro è completato quando gli insiemi di split grandi usano un batch con priorità configurabile, 0 preserva il comportamento attuale, le query più piccole rimangono concorrenti e il comportamento di CountAll/solo count resta corretto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Rust
- Stelle
- 11.8k
- Fork
- 628
- Merge medio
- 2g 22h
- PR unite (30g)
- 50
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di quickwit-oss/quickwit
-
area:otel documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
quickwit-oss/quickwit#6686 ·
I maintainer di solito rispondono entro 1 giorno
-
Add some examples of requests in the REST API reference docsForse già presa @Cunninger l’ha presa 88 giorni fa. Apertaenhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
quickwit-oss/quickwit#4266 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
quickwit-oss/quickwit#3872 ·
I maintainer di solito rispondono entro 1 giorno
-
Update docs on range queriesApertadocumentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
quickwit-oss/quickwit#3666 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
quickwit-oss/quickwit#2769 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di quickwit-oss/quickwit
Issue simili
-
[M09] Silence parser misreads ffmpeg times in scientific notation (6.25e-05 → 6.25 s)Forse già presa @G-darshan-32 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
clipy-recorder/clipy#164 · 1 commento ·
-
p2 ready-mac
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
quickwit-oss/tantivy#3299 ·
I maintainer di solito rispondono entro 1 giorno
-
P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
arcships/dim#2294 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
`stream enable` fails with "already enabled" on every fresh session since streaming became always-onAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
vercel-labs/agent-browser#2797 ·
I maintainer di solito rispondono entro 1 giorno