diff --git a/erigon-lib/downloader/downloadercfg/downloadercfg.go b/erigon-lib/downloader/downloadercfg/downloadercfg.go index a9aaf1beccc..d1051af0b97 100644 --- a/erigon-lib/downloader/downloadercfg/downloadercfg.go +++ b/erigon-lib/downloader/downloadercfg/downloadercfg.go @@ -17,6 +17,7 @@ package downloadercfg import ( + "github.com/ledgerwatch/erigon-lib/common/dbg" "net" "net/url" "os" @@ -65,7 +66,7 @@ func Default() *torrent.ClientConfig { // better don't increase because erigon periodically producing "new seedable files" - and adding them to downloader. // it must not impact chain tip sync - so, limit resources to minimum by default. // but when downloader is started as a separated process - rise it to max - //torrentConfig.PieceHashersPerTorrent = cmp.Max(1, runtime.NumCPU()-1) + torrentConfig.PieceHashersPerTorrent = dbg.EnvInt("DL_HASHERS", min(16, max(2, runtime.NumCPU()-2))) torrentConfig.MinDialTimeout = 6 * time.Second //default: 3s torrentConfig.HandshakesTimeout = 8 * time.Second //default: 4s