1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-23 16:26:11 +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 {
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 {