cache icon indicating copy to clipboard operation
cache copied to clipboard

Slow cache retrieval speeds on the self-hosted runners

Open igorwojda opened this issue 2 years ago • 5 comments

In my setup the cache retrieval step is the longest step for each action:

image

It takes around 3-4 minutes to download and extract a 515MB cache file:

image

Host OS Ubuntu 22

Host Internet connection speed: This file wget http://speedtest.novoserve.com/files/10GB.bin download speed is 40-55MB/s

Host CPU: Intel(R) Xeon(R) Silver 4310 CPU @ 2.10GHz (12 cores)

Host I/O hdparm -Tt /dev/sda

  • Timing cached reads: 9070 MB/s
  • Timing buffered disk reads: 1600MB/s

d if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync

  • Write: 937 MB/s

Config

      - uses: actions/cache@v3
        with:
          path: ~/.gradle
          key: gradle-${{ hashFiles('gradle-checksums.txt') }}-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
          restore-keys: |
            gradle-${{ hashFiles('gradle-checksums.txt') }}-

Questions

  • Is there any way to speed up the network cache retrieval?
  • Is there a way to configure a local disk cache for the self-hosted runners? (ideally shared between runners)

igorwojda avatar Mar 29 '23 20:03 igorwojda

FIY: It looks like all runners are reusing Gradle cache (/home/ubuntu/.gradle), so for my setup actions/cache is not required at all (still it would be nice to have the ability to utilize local cache).

igorwojda avatar Mar 29 '23 21:03 igorwojda

Has a local cache been added by now. Build and security test take me 6 mins upload and download take me 50min. This is unnecessary as I want to have my cache on my runner and not somewhere in the stars

amadou-6e avatar Sep 29 '24 05:09 amadou-6e

+1 @igorwojda please consider reopening this, as the questions proposed are still very valid

redvinaa avatar Dec 02 '24 13:12 redvinaa

The cache should be held in the self-hosted runner instead of github, no need for network downloads and uploads

cedvdb avatar May 29 '25 11:05 cedvdb

The cache should be held in the self-hosted runner instead of github, no need for network downloads and uploads

I’m using a mix of self-hosted and GitHub-hosted runners, so I’d still prefer a solution where caches remain stored on GitHub. However, it would be highly beneficial if self-hosted runners could maintain a local copy of any cache archive they have previously downloaded or generated. That way, subsequent runs on the same runner wouldn’t need to repeatedly download the same cache from GitHub.

chroberino avatar Oct 21 '25 06:10 chroberino