perf: sequential fetch of `InRelease`

Đang mở
#341 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
57/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
backend, performance

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
434
Fork
74
Merge trung bình
1 ngày 30 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của canonical/chisel

Tất cả issue của canonical/chisel

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.