Open chreekat opened 5 years ago
I've noticed this too, it has been this way for some time :/. I've thought about using a caching proxy or something as a kludge-fix, but really it'd be best to avoid all the duplicate work altogether (and I'm unsure how much a role the request plays vs other work).
Last time I looked at this, I got as far as "it's uses javascript" (not my strongest :3), "it caches lookups based on nix AST of the expression evaluated", dunno if I found if AST's were different (perhaps in unimportant ways) or if there was a bug in the caching. Oh, and because javascript is confusing :P it might be the case that the cache works just fine but is limited to each invocation, and we're invoking it for each package or something?
Haha, hope this helps! Fixing this would help a lot, and facilitate more regular updating.
I marked this as stale due to inactivity. → More info
Issue description
I ran generate.sh as per Nixpkgs manual §9.11, and before it had even finished I noticed a great number of duplicate requests to npmjs.org.
Since I'm not certain about npm's inner workings, I used tcpdump to confirm that duplicate HTTP requests are being sent.
Some stats
74% of all requests are duplicates.
Note: all the below is only v10 packages, and I canceled the script before it even ran to completion. (I'm running it again just to confirm.)
Edit: generate.sh fails on master@f0ec7c6f072e0c734d95d3a62344c949faa3443a right now anyway, but I still get the following stats:
(5881.0 - 1541)/5881 ~ .74
: 74% of requests are duplicates.An example
Steps to reproduce
Technical details
"x86_64-linux"
Linux 4.14.114, NixOS, 18.09.2543.41245517a98 (Jellyfish)
yes
yes
nix-env (Nix) 2.1.3
"nixos-18.09.2543.41245517a98"
"unstable-19.09pre173349.07b42ccf2de"
/nix/var/nix/profiles/per-user/root/channels/nixos