Prevent local backend file fragmentation by file preallocation.#3261
Prevent local backend file fragmentation by file preallocation.#3261MichaelEischer merged 3 commits intorestic:masterfrom DRON-666:prealloc-packs
Conversation
|
Additionally I tried various Windows-specific prealocation methods instead of the generic
None - Master branch The data in the columns is not comparable because they correspond to different computers and backup sources. |
|||||||||||||||||||||||||||||||||||||||||||||
MichaelEischer
left a comment
There was a problem hiding this comment.
As far as I know, Truncate internally calls SetFileInformationByHandle(FileEndOfFileInfo).
Regarding the results of the external SMR drive: I wonder whether this is related to writing multiple files to the backend at the same time which together with the flush calls requires writing to different locations on the HDD. Could you try what happens when there's only a single filestorer or when the local backend does not fsync?
|
@MichaelEischer Thanks a lot for the review, I'll fix it tomorrow.
No, it's FileEndOfFileInfo+FileAllocationInfo (Method65):
Yes, of course, but every test run takes many hours, so give me a few days. |
|
@MichaelEischer TL;DR By disabling fsync, you will get a speedup of two or three times. Single filestorer is a bad thing on SMR.
None - Master branch |
||||||||||||||||||||||||||||||
|
@DRON-666 Could you repeat the measurements for this PR one last time? With the increased pack size of 16MB, I'd expect the performance regression on the SMR disk to be far lower. If that's the case, then I think we should just merge this PR. And if not, then let's close the PR. |
|
It's not the same SMR drive (now i have only two ST6000DM003), but results are very promising: |
MichaelEischer
left a comment
There was a problem hiding this comment.
LGTM. The measurements look encouraging :-) . Sorry for taking so long to get this merged!
What does this PR change? What problem does it solve?
File preallocation has already been added to the restorer, but not to the local backend.
This PR moves preallocation code from
restorerto thefspackage and adds preallocation to the local backend.Before this PR:
Many files are split into 10-20 fragments.
After this PR:
Only the
datadir (containing 256 subdirs) is fragmented.Was the change discussed in an issue or in the forum before?
#2679
#2893
Checklist
changelog/unreleased/that describes the changes for our users (template here)gofmton the code in all commits