Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tar download very slow #10683

Open
shyim opened this issue May 12, 2024 · 5 comments
Open

Tar download very slow #10683

shyim opened this issue May 12, 2024 · 5 comments
Labels
bug fetching Networking with the outside (non-Nix) world performance

Comments

@shyim
Copy link
Member

shyim commented May 12, 2024

Describe the bug

When running nix flake update, it downloads the tar.gz file, which takes a lot of time. This usually takes me a minute, but for my colleagues, it takes some time up to half an hour.

image

The same download using curl takes just a second:

❯ time curl -L -o foo.tar.gz 'https://github.com/NixOS/nixpkgs/archive/e4e7a43a9db7e22613accfeb1005cca1b2b1ee0d.tar.gz'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 40.4M  100 40.4M    0     0  24.2M      0  0:00:01  0:00:01 --:--:-- 28.5M

________________________________________________________
Executed in    1.68 secs      fish           external
   usr time  225.63 millis   92.00 micros  225.54 millis
   sys time  129.86 millis  978.00 micros  128.89 millis

I suspect that Nix does a range download and GitHub does not like that and have to export the tar always again from GIt 🤔

Steps To Reproduce

  1. Run a nix flake update so nixpkgs fetches the new tarball

Expected behavior

A clear and concise description of what you expected to happen.

nix-env --version output

❯ nix-env --version
nix-env (Nix) 2.22.0

Additional context

Add any other context about the problem here.

Priorities

Add 👍 to issues you find important.

@shyim shyim added the bug label May 12, 2024
@JayanSmart
Copy link

I can reproduce this on a 1Gbps connection, I am taking over 10 min's to download the tarball when I run the following command on a fresh nix install:
echo "Hello world" | nix run "nixpkgs#cowsay"

@edolstra
Copy link
Member

Can you check if the slow performance also happens with Nix 2.20 (nix shell nix/2.20.6)? It might be related to the Git-based tarball cache that we started using in 2.21.

@Rucadi
Copy link

Rucadi commented May 14, 2024

I was having the same problem with centos7, (inside a container), works well in an ubuntu host, using the latest nix from unstable.

@roberth roberth added performance fetching Networking with the outside (non-Nix) world labels May 15, 2024
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-05-15-nix-team-meeting-minutes-146/45491/1

@shyim
Copy link
Member Author

shyim commented May 18, 2024

2.20.6 is A LOT faster for me. With 2.21 it's slow again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fetching Networking with the outside (non-Nix) world performance
Projects
None yet
Development

No branches or pull requests

6 participants