mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 06:46:34 +00:00
archiver: Reduce tree saver concurrency
Large amount of tree savers have no obvious benefit, however they can increase the amount of (potentially large) trees kept in memory.
This commit is contained in:
parent
bba1e81719
commit
fa25d6118e
@ -128,9 +128,12 @@ func (o Options) ApplyDefaults() Options {
|
||||
}
|
||||
|
||||
if o.SaveTreeConcurrency == 0 {
|
||||
// use a relatively high concurrency here, having multiple SaveTree
|
||||
// workers is cheap
|
||||
o.SaveTreeConcurrency = o.SaveBlobConcurrency * 20
|
||||
// can either wait for a file, wait for a tree, serialize a tree or wait for saveblob
|
||||
// the last two are cpu-bound and thus mutually exclusive.
|
||||
// Also allow waiting for FileReadConcurrency files, this is the maximum of FutureFiles
|
||||
// which currently can be in progress. The main backup loop blocks when trying to queue
|
||||
// more files to read.
|
||||
o.SaveTreeConcurrency = uint(runtime.GOMAXPROCS(0)) + o.FileReadConcurrency
|
||||
}
|
||||
|
||||
return o
|
||||
|
Loading…
Reference in New Issue
Block a user