Remove blob size cache from restic mount#2787
Conversation
c5ebe1e to
301b927
Compare
|
What has changed since #820 / #998 such that restic no longer needs a blob size cache? The Index/MasterIndex structure back in restic v0.4.0 at first glance seems to be rather similar to the current state. (Or could this have something to do with debug logging? #1549 also seems to have sped up index lookups a lot) |
|
@MichaelEischer I have honestly no idea. I've never been able to reproduce #820. In any case, with #2788 and/or #2789, there shouldn't be a performance issue left, at least not in the single-client case. |
|
@MichaelEischer I also don't have any idea why the blob size cache could significantly increase speed... The only issue I see is with a lot of index files as Moreover, #2587 will make So I suggest to remove this memory-hungry cache and leave further speed optimizations to #2587 or to a future PR that stores all loaded index information in one single data structure. |
|
If the performance problem that was tackled using the blob size cache still exists, then #2587 only moves the incredibly slow operation from listing the directory to opening the file. That would improve performance a bit, but whether you have to wait 12 or 9 minutes (just taking the numbers from #820) isn't that much of a difference. I'm actually able to reproduce the performance problem (tested on macOS, #820 was reported on Linux): I've mounted a backup containing a folder with a 100 GB VM image. The first call to I've noticed that the backup repository has 527 index files which for sure doesn't help the index performance, but that many index files are probably not too uncommon. |
|
Does a second ls use the filesystem cache? |
|
@greatroar Please rebase this PR to the current master. The index implementation is probably fast enough by now to avoid a (big) performance regression. |
301b927 to
07da61b
Compare
|
Done! |
MichaelEischer
left a comment
There was a problem hiding this comment.
LGTM. In my tests the performance seemed to be around two times slower than before. Which should be fine especially once #2587 is completed.
What is the purpose of this change? What does it change?
It removes the blob size cache from restic mount.
Peak RAM of restic mount followed by immediate umount goes down from 1.33GiB to 955.8MiB for a 1TB local repo, a 29.6% reduction.
This cache is designed to speed up listing of huge files. However, I don't see any performance problem when removing it, if I backup a 100GiB file of random data and ls -l that in a mountpoint. ls exits instantly even on the first run with a fresh mount.
Was the change discussed in an issue or in the forum before?
The cache was added in #998 to solve #820.
#2587 tackles restic mount performance and also removes this cache, but seems stalled. In #2585, I removed the cache and suggested some optimizations that I no longer think are the right way to solve potential performance issues. I think it should easy enough to merge/rebase #2587 with this patch.
Checklist
changelog/unreleased/that describes the changes for our users (template here)gofmton the code in all commits