Build cache takes ~30 seconds to restore. Why?

matt's Avatar

matt

07 Sep, 2017 09:44 PM

We recently started using the build cache for our NuGet packages and it actually seems to take longer than just downloading the packages.

Here's the relevant timing in a build log:
[00:00:16] Restoring build cache
[00:00:16]
[00:00:29] Cache 'packages' - Calculating dependencies checksum...
[00:00:29] Cache 'packages' - Downloading (174,421,223 bytes)...1%
[00:00:29] Cache 'packages' - Downloading (174,421,223 bytes)...10%
[00:00:30] Cache 'packages' - Downloading (174,421,223 bytes)...20%
[00:00:30] Cache 'packages' - Downloading (174,421,223 bytes)...30%
[00:00:30] Cache 'packages' - Downloading (174,421,223 bytes)...40%
[00:00:30] Cache 'packages' - Downloading (174,421,223 bytes)...50%
[00:00:30] Cache 'packages' - Downloading (174,421,223 bytes)...60%
[00:00:31] Cache 'packages' - Downloading (174,421,223 bytes)...70%
[00:00:31] Cache 'packages' - Downloading (174,421,223 bytes)...80%
[00:00:31] Cache 'packages' - Downloading (174,421,223 bytes)...90%
[00:00:31] Cache 'packages' - Downloading (174,421,223 bytes)...100%
[00:00:48] Cache 'packages' - Unzipping...
[00:00:48] Cache 'packages' - Restored
[00:00:48] Invoke-Expression "nuget.exe restore"

I'm wondering if the settings are wrong. Here's what I put under "Cached directories and files":
packages -> **\packages.config

Is there any way to speed this up? My goal here is to remove the NuGet dependency (for most builds anyway) and hopefully speed up the build in the process.

I did search for related issues but the relevant issue was 2 years ago, so I figured I'd start a new thread.

Thanks!

Matt

  1. 1 Posted by Ilya Finkelshte... on 07 Sep, 2017 10:11 PM

    Ilya Finkelshteyn's Avatar

    You can decrease compression level as described here. However not sure if this will speed this up too much in your case. Cash is located in high performance storage in the same datacenter as AppVeyor workers. I believe you will mostly benefit from it on "rainy day" when nuget.org or connection to it will not be very fast (it happens sometime).

  2. 2 Posted by matt on 07 Sep, 2017 10:21 PM

    matt's Avatar

    Gotcha, thanks for the quick response. Is my cache just too large to be
    speedy? Not sure what a reasonable cache size is. Just wanted to make sure
    I wasn't doing anything too out of the ordinary.

  3. 3 Posted by Ilya Finkelshte... on 07 Sep, 2017 10:47 PM

    Ilya Finkelshteyn's Avatar

    No. it is not too big. I just see that unzipping does not take too much time, that's why I am not sure that changing compression level will help, but it is still worth trying.

  4. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:19 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac