restore: reduce contention while writing files

This commit is contained in:
Michael Eischer 2025-11-29 23:09:04 +01:00
parent b9afdf795e
commit 0ee9360f3e

View file

@ -79,10 +79,12 @@ func newFileRestorer(dst string,
workerCount := int(connections)
return &fileRestorer{
idx: idx,
blobsLoader: blobsLoader,
startWarmup: startWarmup,
filesWriter: newFilesWriter(workerCount, allowRecursiveDelete),
idx: idx,
blobsLoader: blobsLoader,
startWarmup: startWarmup,
// use a large number of buckets to minimize bucket contention in filesWriter
// buckets are relatively cheap, so we can afford to have a lot of them
filesWriter: newFilesWriter(1024, allowRecursiveDelete),
zeroChunk: repository.ZeroChunk(),
sparse: sparse,
progress: progress,