Peerix doesn't serve all available files
I'm seeing a problem between my computers using peerix, files in the store are not always found
For example, peerix reported INFO:root:Requesting kdyfy1hx3n95vifdi79zparg53r01ah3 from direct local network. when looking for kdyfy1hx3n95vifdi79zparg53r01ah3 and it didn't retrieve it from my computer 10.42.42.102 which is sometimes serving files through peerix (so peerix is working fine). On the peerix NixOS which has the file, peerix reported INFO:peerix.remote:Got request from 10.42.42.150:12304 for kdyfy1hx3n95vifdi79zparg53r01ah3
However, I've been able to manually import it from the remote store using nix-copy-closure --from [email protected] /nix/store/kdyfy1hx3n95vifdi79zparg53r01ah3-rust-1.62.1-x86_64-unknown-linux-gnu.tar.gz to confirm the file was available in the remote store served by peerix.
I can't find a pattern about this issue, using nix build nixpkgs#foobar.inputDerivation to pull dependencies on a system, and running it on with the same nixpkgs on another peerix computer will only download 1/5 of inputs from the peerix node. There are no specific errors in the service logs.
This sometimes happens if the latency is high.
Can you tell me what happens if you pass --timeout when running peerix?
Increasing the timeout from 50 to 500 (a bit random but I wanted to be sure it was doing something) drastically improved the situation. After switching back to 50, cache.nixos.org was often used instead of peerix.
Both computers are on the same LAN and a ping reports only 2ms.
It works way better with a higher timeout, yeah. I used the following config to change the timeout:
systemd.services.peerix.script = lib.mkForce ''
exec ${config.services.peerix.package}/bin/peerix --timeout 1000
'';