Disk polling: investigate excess read bytes for small responses

Aperta
#4,175 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Inizia da DiskReadPlan::read_disk in core/partitions/src/poll_plan.rs e leggi la configurazione condivisa del benchmark, le revisioni e i criteri di valutazione in #4174. Misura i byte richiesti e restituiti, le chiamate di lettura, le riletture, le dimensioni dei batch e le posizioni dello sparse index nei workload elencati, quindi confronta una modifica iniziale al dimensionamento delle letture preservando il comportamento delle letture parziali e della corruzione. Il lavoro è completato quando vengono misurati l’amplificazione delle letture, il tempo trascorso, la CPU e la memoria per poll piccoli e grandi, usando i poll grandi come salvaguardia.

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

Descrizione

performance server

Part of #4174, which records the shared benchmark setup, revisions and evaluation criteria.

DiskReadPlan::read_disk starts with a 1 MiB chunk, capped by remaining persisted bytes. Requested message count does not affect this size: the buffer is allocated and read before records are selected. A poll for one small message can therefore read beyond the complete batch it needs, and adjacent polls may revisit overlapping ranges.

Historical profiles measured the following CPU time in __arch_copy_to_user, the kernel function that copies data into application buffers:

Workload Baseline sampled CPU, µs per poll Candidate sampled CPU, µs per poll
Explicit offset, without concurrent writes 46.973 45.758
Explicit offset, with concurrent writes 57.175 62.033

These old samples motivate inspecting copying, but do not show what fraction is avoidable or predict a latency saving. The shared sampling method and workload limits are in #4174.

  1. Count file bytes requested, bytes returned, read calls, repeated ranges and rereads caused by incomplete batches. Record batch sizes and sparse index starting positions to distinguish necessary reads from excess bytes.
  2. Evaluate one change to initial read sizing. The decoder needs complete batches, and the existing path grows the chunk and rereads when one does not fit. Smaller chunks can therefore trade fewer bytes for more calls and repeated work.
  3. Validate through actual polling across small and larger responses, large batches, active and sealed segments, and concurrent writes. Measure read amplification alongside elapsed time, CPU and memory, with larger polls as a guardrail.

Share counters with #4176 while keeping implementation comparisons separate: fewer read bytes need not mean fewer verified batches. File descriptors and sealed indexes are already cached, and read buffers are allocated without zeroing.

Preserve partial read handling and corruption behavior along with the parent's correctness requirements. If buffer reuse is introduced, bound retained memory and define its behavior during segment growth, purge, truncation and history changes.

Lingua principale
Rust
Stelle
5.2k
Fork
502
Merge medio
3g 11h
PR unite (30g)
143

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 apache/iggy

Tutte le issue di apache/iggy

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.