Skip to content

Commit

Permalink
e2: configurable hashers amount (#10785)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Jun 21, 2024
1 parent c19b034 commit 847d786
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion erigon-lib/downloader/downloadercfg/downloadercfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package downloadercfg

import (
"github.com/ledgerwatch/erigon-lib/common/dbg"
"net"
"net/url"
"os"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 847d786

Please sign in to comment.