JuliaLang/juliaup

`juliaup update` is initially slow to check versions db

Opened this issue · 2 comments

I've been looking into why juliaup update hangs for a while before doing any substantial downloads, even on very fast connections.

I think the issue is that this file may be served via a CDN that needs its caching settings tweaked to be less lazy
https://julialang-s3.julialang.org/juliaup/RELEASECHANNELDBVERSION

It's a very small file, so doesn't make any sense that it takes 7s to download.. so I believe the time is the CDN refreshing a local cache.


From a profile during that quiet ~10s it can be seen that update_version_db is spending 7s waiting on reqwest.

Image

cc. @giordano @davidanthoff

Yes, that makes a ton of sense: the idea is that this file is small so that it can be checked really quickly (clearly not working...). The file is also configured to not be cached by the CDN so that updates are picked up by clients quickly.

I'm not sure what the best strategy is, probably really depends on the CDN, right?

Actually, I caught the slowdown with timing printing added and it seems to be something else.

This is with main...ib/timing

Note I set the db patch version back one, just to exercise all code paths, but that is only hit after the problematic slow one.

% ./target/release/juliaup update
Checking for new Julia versions
Online db version `https://julialang-s3.julialang.org/juliaup/RELEASECHANNELDBVERSION`: Version { major: 1, minor: 0, patch: 55 }
Request to 'https://julialangnightlies-s3.julialang.org/bin/macos/aarch64/julia-latest-macos-aarch64.tar.gz' took 5.979535584s
Direct download etags: [("nightly", "\"2eeb5e6ccc5363b5180feb502f96d919-27\"")]
Bundled db version: Version { major: 1, minor: 0, patch: 54 }
Updating channel nightly

Then immediately after

ian@Ians-MacBook-Pro juliaup % ./target/release/juliaup update
Checking for new Julia versions
Online db version `https://julialang-s3.julialang.org/juliaup/RELEASECHANNELDBVERSION`: Version { major: 1, minor: 0, patch: 55 }
Request to 'https://julialangnightlies-s3.julialang.org/bin/macos/aarch64/julia-latest-macos-aarch64.tar.gz' took 112.53425ms
Direct download etags: [("nightly", "\"2eeb5e6ccc5363b5180feb502f96d919-27\"")]
Bundled db version: Version { major: 1, minor: 0, patch: 54 }