From bba1e81719d1e8b5033f0380c18b9588a5448532 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 7 Aug 2021 23:18:37 +0200 Subject: [PATCH] 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. --- internal/archiver/archiver.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/archiver/archiver.go b/internal/archiver/archiver.go index 90b9e6904..5aa509449 100644 --- a/internal/archiver/archiver.go +++ b/internal/archiver/archiver.go @@ -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 {