From: Matt Joiner Date: Fri, 16 Feb 2018 01:15:56 +0000 (+1100) Subject: Adjust some config defaults X-Git-Tag: v1.0.0~163 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=aab77ab05d736afb2436ca36ab603786f5fce2a1;p=btrtrc.git Adjust some config defaults --- diff --git a/config.go b/config.go index ff222b32..860f6cd1 100644 --- a/config.go +++ b/config.go @@ -130,16 +130,17 @@ func (cfg *Config) setDefaults() { cfg.MinDialTimeout = 5 * time.Second } if cfg.EstablishedConnsPerTorrent == 0 { - cfg.EstablishedConnsPerTorrent = 80 + cfg.EstablishedConnsPerTorrent = 50 } if cfg.HalfOpenConnsPerTorrent == 0 { - cfg.HalfOpenConnsPerTorrent = 80 + cfg.HalfOpenConnsPerTorrent = (cfg.EstablishedConnsPerTorrent + 1) / 2 } if cfg.TorrentPeersHighWater == 0 { + // Memory and freshness are the concern here. cfg.TorrentPeersHighWater = 500 } if cfg.TorrentPeersLowWater == 0 { - cfg.TorrentPeersLowWater = 50 + cfg.TorrentPeersLowWater = 2 * cfg.HalfOpenConnsPerTorrent } if cfg.HandshakesTimeout == 0 { cfg.HandshakesTimeout = 20 * time.Second