go-libp2p
go-libp2p copied to clipboard
swarm: rate limit establishing new connections
I'm on a new internet connection since a few weeks and I'm noticing interesting pattern with the ISP provided router - it can handle 1000s of connections just fine, but whenever I try to establish 100+ connections is a really short time (around 1 connection/ms), it just freezes for a few seconds or just dies (same with closing connections, but that's an issue for connmgr).
Note that this should be optional as it may impact DHT performance quite a bit
Interesting... We should also be able to use relays without killing the DHT too much but the problem there is:
- Picking the relay.
- Not killing the relay.
- Switching away from the relay for, e.g., bitswap.
Note: This could also be due to the number of connection attempts we make. We should probably limit the number of dials we attempt per peer to, e.g., 10-20 at most.
We now have a dial pacer in the DHT: https://github.com/libp2p/go-libp2p-kad-dht/pull/237.