perf: sequential fetch of `InRelease`

Aperta
#341 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
57/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

Start in internal/archive/archive.go and trace how setupIndexes calls fetchRelease for each suite, including signature verification and parsing. The issue proposes concurrent suite fetches; first check the existing archive tests and how they cover suite setup. Done means fetching the configured suites concurrently while preserving verification and parsing behavior, with tests covering the result.

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

Descrizione

context

a cache-hot chisel cut of one small slice takes about 0.6-1.2s, and most of that is three InRelease round trips done one after another. setupIndexes (internal/archive/archive.go) loops over the suites in order and for each one fetchRelease downloads InRelease, verifies the signature and parses it before the next suite starts. with suites: [resolute, resolute-security, resolute-updates] that is three sequential https requests to the archive, 0.1-0.45s each depending on the archive's mood.

three runs of the same hot (🌶️) cut of python3-yaml_libs:

                       mean     std  <- 3 runs
suite details x3      530ms   290ms  InRelease fetch, verify, parse; sequential
index fetch x6         80ms    20ms  cache hits, parse
deb fetch + extract   260ms    20ms  cache hits
total                   ~1s  ~300ms

so 40-70% of a warm cut is waiting on 3 serial InRelease's. for a single image build it is a second, however for anything that cuts many times against one checkout it is the fixed cost of every cut (can you see a theme to my recent issues yet... 😅 non-contrived non-un-release example could be the chisel-releases ci though).

also, this gets worse with worse network (O(N) but git grad >1 so 150ms of lag will incur ~S*lag cost where S is n-of-suites aka ~3)

                     mean   std
direct (~40ms)      600ms  30ms
proxy +150ms        1.30s  80ms
proxy +300ms        1.77s  30ms

proposal

fetch the suites concurrently.

the suite's main and universe Packages could be fetched concurrently too, which matters on a cold cache (two ~75MB downloads per suite).

optionally, we could start a spiritual successor of the discussion from #254 and honour Valid-Until for InRelease files.

Lingua principale
Go
Stelle
434
Fork
74
Merge medio
1g 30m
PR unite (30g)
1

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

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 canonical/chisel

Tutte le issue di canonical/chisel

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.