go-libp2p icon indicating copy to clipboard operation
go-libp2p copied to clipboard

swarm: rate limit establishing new connections

Open magik6k opened this issue 7 years ago • 3 comments

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).

magik6k avatar Sep 14 '18 04:09 magik6k

Note that this should be optional as it may impact DHT performance quite a bit

magik6k avatar Sep 14 '18 04:09 magik6k

Interesting... We should also be able to use relays without killing the DHT too much but the problem there is:

  1. Picking the relay.
  2. Not killing the relay.
  3. 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.

Stebalien avatar Sep 14 '18 05:09 Stebalien

We now have a dial pacer in the DHT: https://github.com/libp2p/go-libp2p-kad-dht/pull/237.

raulk avatar Jan 31 '19 19:01 raulk