mirror of
https://github.com/restic/restic.git
synced 2024-12-23 08:16:36 +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:
parent
120ccc8754
commit
bba1e81719
1 changed files with 3 additions and 1 deletions
|
@ -122,7 +122,9 @@ func (o Options) ApplyDefaults() Options {
|
|||
}
|
||||
|
||||
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 {
|
||||
|
|
Loading…
Reference in a new issue