From 22204b49dd4f27deb51be111c48478a86c5de58f Mon Sep 17 00:00:00 2001 From: cy Date: Fri, 14 Mar 2025 13:19:36 -0400 Subject: [PATCH 1/2] patch attic to prefetch 32 chunks instead of 2 --- overlay/attic/default.nix | 7 +++++++ overlay/attic/prefetch-32-chunks.patch | 13 +++++++++++++ overlay/default.nix | 1 + 3 files changed, 21 insertions(+) create mode 100644 overlay/attic/default.nix create mode 100644 overlay/attic/prefetch-32-chunks.patch diff --git a/overlay/attic/default.nix b/overlay/attic/default.nix new file mode 100644 index 0000000..14f5daf --- /dev/null +++ b/overlay/attic/default.nix @@ -0,0 +1,7 @@ +final: prev: { + attic-server = prev.attic-server.overrideAttrs { + patches = [ + ./prefetch-32-chunks.patch + ]; + }; +} diff --git a/overlay/attic/prefetch-32-chunks.patch b/overlay/attic/prefetch-32-chunks.patch new file mode 100644 index 0000000..bbb801b --- /dev/null +++ b/overlay/attic/prefetch-32-chunks.patch @@ -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 + }); diff --git a/overlay/default.nix b/overlay/default.nix index 3a655fd..0eea626 100644 --- a/overlay/default.nix +++ b/overlay/default.nix @@ -3,6 +3,7 @@ let overlays = [ ./zipline ./bitwarden + ./attic ]; importedOverlays = map (m: import m) overlays; in From ffd7dc5ae64649c60a2e83711009cb28e5d2e45e Mon Sep 17 00:00:00 2001 From: cy Date: Fri, 14 Mar 2025 13:19:44 -0400 Subject: [PATCH 2/2] disable cachix cache --- flake.nix | 2 -- hosts/common.nix | 4 ---- 2 files changed, 6 deletions(-) diff --git a/flake.nix b/flake.nix index 494ce4f..3f362e2 100644 --- a/flake.nix +++ b/flake.nix @@ -114,13 +114,11 @@ extra-substituters = [ "https://nix-community.cachix.org" "https://cache.garnix.io" - "https://cything.cachix.org" "https://cache.cy7.sh/main" ]; extra-trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" - "cything.cachix.org-1:xqW1W5NNL+wrM9wfSELb0MLj/harD2ZyB4HbdaMyvPI=" "main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0=" ]; builders-use-substitutes = true; diff --git a/hosts/common.nix b/hosts/common.nix index 0fb2fc6..bfa70e3 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -10,17 +10,13 @@ "@wheel" ]; trusted-public-keys = [ - "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" - "cything.cachix.org-1:xqW1W5NNL+wrM9wfSELb0MLj/harD2ZyB4HbdaMyvPI=" "main:Ku31HoEWcBtfggge2VGj+QTkVrQuIwRIMGyfV/5VQP0=" ]; substituters = [ - "https://niri.cachix.org" "https://nix-community.cachix.org" "https://cache.garnix.io" - "https://cything.cachix.org" "https://cache.cy7.sh/main" ]; };