uv icon indicating copy to clipboard operation
uv copied to clipboard

Warn when registry doesn't support range requests for wheels

Open konstin opened this issue 1 year ago • 4 comments

Range requests are very important for uv's performance, especially with large wheels. They are the difference between downloading entire wheels and just some slices in the bytes to KB range. They have been part of the HTTP/1.1 and are supported by all major webserver and blob storages. We should warn users if their registry is misconfigured and doesn't support range requests. Without a warning, it is otherwise inexplicable to users why uv is slower than advertised.

konstin avatar Feb 21 '24 09:02 konstin

I don’t think these should be user-facing, since users typically have no control over this.

charliermarsh avatar Feb 21 '24 12:02 charliermarsh

I expect they'll need to forward this to whoever is managing their server, but i tend towards making it user visible as otherwise nobody will see this is missing.

konstin avatar Feb 21 '24 12:02 konstin

But like, Artifactory doesn’t support this at all. Making these user-visible means Artifactory users will see these on every invocation with no recourse.

charliermarsh avatar Feb 21 '24 12:02 charliermarsh

It's a difficult one. Making it visible to users could motivate artifactory to add support for it but showing it on every invocation sounds annoying. I wonder if there are other ways we could achieve the same. Maybe with a --profile flag that tells you where uv spends time.

MichaReiser avatar Feb 21 '24 12:02 MichaReiser

Perhaps only display the message if the just run command spent more than 1 second downloading wheels from a registry that does not support range queries. Something like:

This took longer than expected because registry (url) does not support Http 1.1 range queries.

Eh2406 avatar Apr 10 '24 22:04 Eh2406

more than 1 second downloading wheels

So every time for large pytorch (or other ml/data ecosystem libraries) wheels on registries that don't support range requests? I'd still lean to call it noise that's not usually not actionable for most users.

edit: If verbose mode shows this that's fine. If some flag related to performance shows this that's also reasonable. On every request sounds like a lot of corporate indices are likely to be noisy and fun time trying to find registry owner/asking them to work on it.

edit 2: Aggressive/smart caching uv has is very nice on a non-first run regardless of index having range requests.

hmc-cs-mdrissi avatar Apr 11 '24 01:04 hmc-cs-mdrissi