You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since we've received a number of issues related to network issues impacting save/restore, I'm creating a "catch all" issue to track the investigation and mitigation.
The figure below shows the max server latency from our cloud storage provider for one of the storage accounts (the cache service uses 16 total, but all show similar trends). There's a clear increase in high latency requests the past two weeks or so.
I've escalated with our provider and they have started an investigation. I'll update here as we know more.
Following here (from #265). Would be great if at least network failure was detected probably (during restore) and either the action failing or at least leaving disk empty, instead of a half restored and corrupted state on disk, that for us breaks following steps.
We're seeing this as well, restoring ~300mb of ruby gems with unpredictable delays.
I've seen as fast as 9s (seconds), average of 15-20s, and hundreds of highs of 40s, 50s, 3m20s, 5m, using [email protected] (and other vanilla cache tags) we have ran ~10,000 cache pulls.
I've tested switching to zstd compression, and while the compression and unpackaging is faster, we are still seeing slow retrieval swings, as high as 50 second retrieval in the ~400 tests I ran with zstd.
@pjoe I've yet to try this, but the docs say you can set a step timeout that will kill the process if the step exceeds that limit. Note, however, that this will cause the step to fail. What we really need is a cache-specific timeout that will abort the restore but allow the workflow to continue, treating it like a cache miss.
Thanks for the replies to this issue -- unfortunately something like continue-on-error (while we use it elsewhere in our build) and any logic to skip on timeout are not sufficient, as this would result in a 2-3 minute bundle install instead of the 10s-5m cache pull/unzip.
I agree that just running bundle install on every iteration is more predicatable, but we are seeing a lot of successful cache pull's at sub-20 seconds and I cannot justify aborting a long pull to reinstall the entire gem bundle.
For us, this would only work if we set our timeout to 2 minutes -- but then we are still having jobs wait 2 minutes to pull cache to then abort and spend 2-3 more minute installing the bundle cache.
@munrocket Yes, that's part of the issue. We're using the same http-client. I already have a PR to validate the file length (#269) but am also testing out the approach used by actions/setup-node#116 to detect errors (using util.promisify(stream.pipeline)).
I'm also seeing the problem of the cache restores being very slow. It's ranging anywhere between a few seconds to 24 minutes as well as it just giving up after a period of time
I hope v3 fixes the speed issues, but it is at the point where GH should remove the recommendation to use this action to "speed up workflows" from their main documentation, or at least put a prominent warning. We've removed caching from our workflows because at best caching saves 5 minutes per job (45 compute total minutes per workflow, that we pay for), and frequently just costs much much more than that.
FWIW I saw something similar the past couple of days, with cache downloading for a ~300 MB cache taking around 5 minutes (example run).
As a workaround, it'd be great if I could specify a timeout for cache downloading - something like "please skip the cache if it's still downloading after 15 seconds".
edit: Nevermind, this has been mentioned here before - sorry, should've skimmed through the existing replies first! 🙈
We've released v2.1.0 of the cache action yesterday. If you're using actions/cache@v2, you will automatically use this latest version.
This switches from the http-client to the Azure Storage SDK for NodeJS for downloading the cache content. The http-client treated the file as one large stream, whereas the Storage SDK splits it into 4 MB chunks. In addition to being able to download the chunks in parallel, we set a 30 sec timeout on each chunk and include retries, which should hopefully restart any slow connections.
With this new version, you'll also see it print out download progress:
Received 0 of 1682754204 (0.0%), 0.0 MBs/sec
Received 92274688 of 1682754204 (5.5%), 44.0 MBs/sec
Received 218103808 of 1682754204 (13.0%), 69.3 MBs/sec
Received 335544320 of 1682754204 (19.9%), 80.0 MBs/sec
Received 461373440 of 1682754204 (27.4%), 88.0 MBs/sec
Received 583008256 of 1682754204 (34.6%), 92.6 MBs/sec
Received 675282944 of 1682754204 (40.1%), 91.9 MBs/sec
Received 775946240 of 1682754204 (46.1%), 92.4 MBs/sec
Received 868220928 of 1682754204 (51.6%), 91.9 MBs/sec
Received 964689920 of 1682754204 (57.3%), 91.9 MBs/sec
Received 1052770304 of 1682754204 (62.6%), 91.2 MBs/sec
Received 1124073472 of 1682754204 (66.8%), 89.2 MBs/sec
Received 1195376640 of 1682754204 (71.0%), 87.6 MBs/sec
Received 1262485504 of 1682754204 (75.0%), 85.9 MBs/sec
Received 1342177280 of 1682754204 (79.8%), 85.3 MBs/sec
Received 1413480448 of 1682754204 (84.0%), 84.2 MBs/sec
Received 1480589312 of 1682754204 (88.0%), 83.0 MBs/sec
Received 1547698176 of 1682754204 (92.0%), 81.9 MBs/sec
Received 1619001344 of 1682754204 (96.2%), 81.2 MBs/sec
Received 1678559900 of 1682754204 (99.8%), 80.0 MBs/sec
Received 1678559900 of 1682754204 (99.8%), 76.2 MBs/sec
Received 1682754204 of 1682754204 (100.0%), 51.1 MBs/sec
Cache Size: ~1605 MB (1682754204 B)
@dhadka
That's a gr8 improvement, but still not as fast as one would expect.
Download is fast now, however untarring the cache is still VERY slow.
It takes us whole 49s to untar only 850MB. (we cache python installation)
On my VM it takes only 15seconds using gzip which should be slower than zstd.
Is it possible that compression is mal-configured to a strict compression-level ? Is the disk super-duper slow on writing many files ?
Here is the log that show the decompression step takes 49s.
The decompression command that takes 49s is (copied from the logs above) /bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/6b8290d8-2585-4bf3-be99-27773859afcd/cache.tzst -P -C /home/runner/work/datascience/datascience
Same question here, the environment caching is really amazing, works smooth, and the network-recovery is not the bottleneck at all. But, on Windows, extracting the TAR file takes way too long compared to macOS and linux:
Activity
pjoe commentedon Apr 21, 2020
Following here (from #265). Would be great if at least network failure was detected probably (during restore) and either the action failing or at least leaving disk empty, instead of a half restored and corrupted state on disk, that for us breaks following steps.
pjoe commentedon Apr 21, 2020
Is there a way to set a timeout for cache restore?
In current situation we are burning build minutes just waiting for cache restore that eventually times out and leaves corrupted cache on disk :(
alexhraber commentedon Apr 22, 2020
We're seeing this as well, restoring ~300mb of ruby gems with unpredictable delays.
I've seen as fast as 9s (seconds), average of 15-20s, and hundreds of highs of 40s, 50s, 3m20s, 5m, using [email protected] (and other vanilla cache tags) we have ran ~10,000 cache pulls.
I've tested switching to zstd compression, and while the compression and unpackaging is faster, we are still seeing slow retrieval swings, as high as 50 second retrieval in the ~400 tests I ran with zstd.
cc @chrispat
dhadka commentedon Apr 22, 2020
@pjoe I've yet to try this, but the docs say you can set a step timeout that will kill the process if the step exceeds that limit. Note, however, that this will cause the step to fail. What we really need is a cache-specific timeout that will abort the restore but allow the workflow to continue, treating it like a cache miss.
I've also been exploring socket timeouts. Here is an example of it aborting a slow download.
chrispat commentedon Apr 22, 2020
@dhadka you can set
continue-on-erroron the step and then use the newoutcomeon the steps context https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#steps-context to condition other steps.alexhraber commentedon Apr 23, 2020
Thanks for the replies to this issue -- unfortunately something like
continue-on-error(while we use it elsewhere in our build) and any logic to skip on timeout are not sufficient, as this would result in a 2-3 minute bundle install instead of the 10s-5m cache pull/unzip.I agree that just running bundle install on every iteration is more predicatable, but we are seeing a lot of successful cache pull's at sub-20 seconds and I cannot justify aborting a long pull to reinstall the entire gem bundle.
For us, this would only work if we set our timeout to 2 minutes -- but then we are still having jobs wait 2 minutes to pull cache to then abort and spend 2-3 more minute installing the bundle cache.
alexhraber commentedon Apr 24, 2020
After playing more w/ caching, it's becoming evident that the issues we are seeing are related to data retrieval.
munrocket commentedon Apr 24, 2020
Here issue that was fixed and looks very similar actions/setup-node/issues/116
alexhraber commentedon Apr 24, 2020
I'm getting around this currently by baking my bundle cache into a docker image with the GA self-hosted runner as the entrypoint. 👍
dhadka commentedon Apr 27, 2020
@munrocket Yes, that's part of the issue. We're using the same
http-client. I already have a PR to validate the file length (#269) but am also testing out the approach used by actions/setup-node#116 to detect errors (usingutil.promisify(stream.pipeline)).JavierMeep commentedon Apr 28, 2020
I am getting this error:
munrocket commentedon Apr 28, 2020
@JavierMeep but nothing changed. Show link to your GA please.
JavierMeep commentedon Apr 28, 2020
@munrocket sorry it is in a private repo.
wlabatey commentedon Apr 28, 2020
Also getting the same 500 error semi-regularly today when attempting to save caches. Project is also in a private repo.
Here's the error message:
33 remaining items
mogusbi commentedon Jul 10, 2020
I'm also seeing the problem of the cache restores being very slow. It's ranging anywhere between a few seconds to 24 minutes as well as it just giving up after a period of time
When it goes bad:

When it goes really bad:

When it goes well:

Workflow in question can be found here: https://github.com/motech-development/platform/blob/master/.github/workflows/checks.yml
Actions here: https://github.com/motech-development/platform/actions
scottjacobsen commentedon Jul 13, 2020
I hope v3 fixes the speed issues, but it is at the point where GH should remove the recommendation to use this action to "speed up workflows" from their main documentation, or at least put a prominent warning. We've removed caching from our workflows because at best caching saves 5 minutes per job (45 compute total minutes per workflow, that we pay for), and frequently just costs much much more than that.
moltar commentedon Jul 14, 2020
I agree with @scottjacobsen here.
I also think GH should provide free credits to everyone who was using this action.
scottjacobsen commentedon Jul 15, 2020
Here's the quick and dirty S3 caching I'm using for now - thought I would share. It doesn't have any bells or whistles, but It has been working well for us, with a 1GB gem cache that changes infrequently. It downloads and extracts in about 40 seconds each time. https://gist.github.com/scottjacobsen/ef7ccdf0ef48080a63e2fd4076d4e83f
moltar commentedon Jul 15, 2020
Nice! Thank you for sharing.
Wonder if that would speed up if you were to use azure.
I think actions run on azure.
Getting it in the same region would probably get it even faster.
The-Compiler commentedon Jul 20, 2020
FWIW I saw something similar the past couple of days, with cache downloading for a ~300 MB cache taking around 5 minutes (example run).
As a workaround, it'd be great if I could specify a timeout for cache downloading - something like "please skip the cache if it's still downloading after 15 seconds".
edit: Nevermind, this has been mentioned here before - sorry, should've skimmed through the existing replies first! 🙈
dhadka commentedon Jul 22, 2020
We've released v2.1.0 of the cache action yesterday. If you're using
actions/cache@v2, you will automatically use this latest version.This switches from the
http-clientto the Azure Storage SDK for NodeJS for downloading the cache content. Thehttp-clienttreated the file as one large stream, whereas the Storage SDK splits it into 4 MB chunks. In addition to being able to download the chunks in parallel, we set a 30 sec timeout on each chunk and include retries, which should hopefully restart any slow connections.With this new version, you'll also see it print out download progress:
dhadka commentedon Jul 27, 2020
Closing since the v2.1.0 release should help with download issues, however, please feel free to re-open or create a new issue if download issues continue.
Bump @actions/cache version
Bump @actions/cache version
shugybugy-assaf commentedon Oct 16, 2020
@dhadka
That's a gr8 improvement, but still not as fast as one would expect.
Download is fast now, however untarring the cache is still VERY slow.
It takes us whole 49s to untar only 850MB. (we cache python installation)
On my VM it takes only 15seconds using gzip which should be slower than zstd.
Is it possible that compression is mal-configured to a strict compression-level ? Is the disk super-duper slow on writing many files ?
Here is the log that show the decompression step takes 49s.

The decompression command that takes 49s is (copied from the logs above)
/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/6b8290d8-2585-4bf3-be99-27773859afcd/cache.tzst -P -C /home/runner/work/datascience/datascienceWe use the approach explained below to cache the python installation directory
https://medium.com/ai2-blog/python-caching-in-github-actions-e9452698e98d
webern commentedon Jun 12, 2021
This doesn't seem to be fixed to me:
ThomasLecocq commentedon Jan 6, 2022
Same question here, the environment caching is really amazing, works smooth, and the network-recovery is not the bottleneck at all. But, on Windows, extracting the TAR file takes way too long compared to macOS and linux:
https://github.com/obspy/obspy/runs/4730492589?check_suite_focus=true
Any idea how I can make this faster ?