perf: take_rows opens a scheduler per fragment, so its I/O concurrency is fragments x LANCE_IO_THREADS

Aperta
#10,528 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
performance

Direzione di ricerca

Start from Dataset::take_rows and FileFragment::open where a ScanScheduler is opened per fragment. Review the branch perf/take-shared-scheduler-main that adds FragReadConfig::with_scan_scheduler and with_base_schedulers in do_take_rows. Run the S3 benchmark from the issue to verify peak GETs align with LANCE_IO_THREADS. Done means a take respects the I/O budget without slowing high-latency reads.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

performance

Observation

Dataset::take_rows opens one ScanScheduler per touched fragment (FragReadConfig carries no scheduler, FileFragment::open creates one with SchedulerConfig::max_bandwidth). The I/O budget of a take is therefore fragments x LANCE_IO_THREADS, not LANCE_IO_THREADS.

Measured on a 2.0 table (52 fragments, 110 scalar columns, ~4 000 GETs per 100-row take) read over S3 from a 290 ms RTT link, lance main at bf867011a:

per-fragment schedulers (main) one scheduler per take, 64 / 256 / 1024 threads
peak GETs in flight 2 300-2 800 at any LANCE_IO_THREADS 64 / 256 / ~1 000
new TLS connections, back-to-back takes 190-350 0
new TLS connections after a 15 s idle gap 1 790 64 / 258 / ~260
warm take, 100 rows 2.2-2.6 s 19 s / 5.2 s / 2.5 s
cold take, 100 rows 4.9-5.1 s, 6.8 s CPU - / 7.3 s, 3.4 s CPU / 4.9 s, 4.7 s CPU

So the per-fragment design is what makes takes fast on high-latency links (one wave of ~2 800 handshakes, then 5-8 round trips), at the cost of thousands of connections (strace: 37 K connect calls, 2 600 TLS handshakes per cold take) and 30-40% more CPU. A shared scheduler bounds all of that but turns the take into GETs / LANCE_IO_THREADS round trips, which is 2-8x slower unless the limit is raised to ~1 000.

Question

Is the unbounded per-fragment concurrency intended? If a take should respect LANCE_IO_THREADS, it needs its own capacity (a multiple of io_parallelism, or an explicit option) so cross-region readers do not regress. The branch perf/take-shared-scheduler-main (12 lines: FragReadConfig::with_scan_scheduler + with_base_schedulers in do_take_rows) is the shared-scheduler variant used for the measurements.

Lingua principale
Rust
Stelle
7.3k
Fork
929
Merge medio
2g 22h
PR unite (30g)
572

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lance-format/lance

Tutte le issue di lance-format/lance

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.