anacrolix / torrent

Full-featured BitTorrent client package and utilities
Mozilla Public License 2.0
5.51k stars 622 forks source link

DNS requests optimization #817

Open AskAlexSharov opened 1 year ago

AskAlexSharov commented 1 year ago

It seems that some DNS requests are done every second: https://github.com/ledgerwatch/erigon/issues/6876#issuecomment-1430855828

Is it possible to optimize it? Probably it's something related to announcement period?

anacrolix commented 1 year ago

Yes it is very likely due to announce failures, maybe some of those hosts aren't resolving, in which case it will occur once a minute until it does. One solution might be to wait for longer on DNS failure if that's the case. But also if you are running many simultaneous torrents like I suspect you are, the DNS lookups should be shared anyway. I also answered in https://github.com/ledgerwatch/erigon/issues/6876#issuecomment-1432833354 by accident, everything there also applies.