2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-23 05:12:10 +00:00

archiver: Limit blob saver count to GOMAXPROCS

Now with the asynchronous uploaders there's no more benefit from using
more blob savers than we have CPUs. Thus use just one blob saver for
each CPU we are allowed to use.
This commit is contained in:
Michael Eischer 2021-08-07 23:18:37 +02:00
parent 120ccc8754
commit bba1e81719

View File

@ -122,7 +122,9 @@ func (o Options) ApplyDefaults() Options {
} }
if o.SaveBlobConcurrency == 0 { if o.SaveBlobConcurrency == 0 {
o.SaveBlobConcurrency = uint(runtime.NumCPU()) // blob saving is CPU bound due to hash checking and encryption
// the actual upload is handled by the repository itself
o.SaveBlobConcurrency = uint(runtime.GOMAXPROCS(0))
} }
if o.SaveTreeConcurrency == 0 { if o.SaveTreeConcurrency == 0 {