actions / cache

Cache dependencies and build outputs in GitHub Actions
MIT License
4.45k stars 1.18k forks source link

Slow cache retrieval speeds on the self-hosted runners #1143

Closed igorwojda closed 1 year ago

igorwojda commented 1 year ago

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

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

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

igorwojda commented 1 year ago

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).