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
1 changed files with 3 additions and 1 deletions

View File

@ -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 {