How can restic be told to not output that warning? I found no option for this. –quiet does not help.
If quiet doesn’t do it, it may not be possible to suppress the warning. That said, it is a warning, not an error. Think of it as restic alerting you that “the options you’ve supplied may cause performance problems”, which you can then ignore as you are a power user and are aware of the consequences of passing --no-cache given your specific setup (cache and repository are on the same physical device).
How could restic determine whether a cache helps or not? There may be fast and slow local storage.
restic could do some short statistics reading cache against reading repo. It could then recommend enabling or disabling the cache - but not with –quiet
Or it might just not use cache if it does not help with speed. If that works reliably, –no-cache would only be needed when running out of disk space.
As you said, the only way restic could “know” whether the cache is useful would be by testing the speed of the cache. Restic would either need to do this before every command (which would introduce a delay, and a bunch of unnecessary reads/writes to the cache device); or run this once and store the results locally, while also reliably detecting when the cache device has changed so that the speed test can be re-run.
This sounds like a lot of additional code to handle one specific repository type: local, and both of these solutions have drawbacks.
- Re-testing the cache before each operation I’d argue is completely unworkable, the performance trade-off would be so large as to outweigh the benefit.
- Testing and recording the speed of the cache sounds more workable, but it means additional code complexity added, with again the only benefit being to slightly reduce the disk space used when using the local back-end.
Why do I say “slightly”? I have a ~300Gb repository, stored on REST Server. The local restic cache directory for this repository is ~215Mb.
At least based on that sample size of one, if you’re storing both the cache and the repository on the same device, the cache directory seems like it is basically a rounding error.
Edit: after some forum searching, other topics suggest cache sizes may vary wildly depending on the workload, so YMMV when it comes to cache size. I would hazard a guess that the topics opened regarding large cache sizes are outliers though (because people don’t open topics to report that the cache is small and working as intended!).