patch attic to prefetch 32 chunks instead of 2

This commit is contained in:
cy 2025-03-14 13:19:36 -04:00
parent 00a8ac69cf
commit 22204b49dd
Signed by: cy
SSH key fingerprint: SHA256:o/geVWV4om1QhUSkKvDQeW/eAihwnjyXkqMwrVdbuts
3 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,7 @@
final: prev: {
attic-server = prev.attic-server.overrideAttrs {
patches = [
./prefetch-32-chunks.patch
];
};
}

View file

@ -0,0 +1,13 @@
diff --git a/server/src/api/binary_cache.rs b/server/src/api/binary_cache.rs
index 02e4857..71eeee8 100644
--- a/server/src/api/binary_cache.rs
+++ b/server/src/api/binary_cache.rs
@@ -262,7 +262,7 @@ async fn get_nar(
// TODO: Make num_prefetch configurable
// The ideal size depends on the average chunk size
- let merged = merge_chunks(chunks, streamer, storage, 2).map_err(|e| {
+ let merged = merge_chunks(chunks, streamer, storage, 32).map_err(|e| {
tracing::error!(%e, "Stream error");
e
});

View file

@ -3,6 +3,7 @@ let
overlays = [
./zipline
./bitwarden
./attic
];
importedOverlays = map (m: import m) overlays;
in