Why so long to connect with known peers?

Kinda, it depends on the numbers. Let me try to explain this:

In order for a server to do its job, it needs to manage its connection pool. It needs to be able to discard connections that aren’t useful to it so that it can open transient connections to other nodes that are useful to the requests it’s working on. This is a very dynamic process. It also accepts transient connections from other nodes looking for things, but those are discarded fairly quickly as well, as they are not useful to what it’s doing.

Now, your node dials the server and sits there. The server asks, would you like anything? and you answer, no I just wanna hang. Bye. It hangs up. The problem is, you dial right back and pull the same stunt. Now, if it’s just you, you’re an annoyance. But, imagine we are talking about a well known server, like ipfs.io (dweb.link), and everybody and his brother thinks he’s oh so clever and will establish an asymmetric peering with that server to improve their situation. Well, none of those connections are useful, so the server tries to get rid of them, only to get redialed immediately. If you have enough of those, they begin to behave like a botnet trying to take down the server.

This is why I advised to only establish symmetric peering, where both sides agree to keep the connection open at all times. No constant churn. And they both agree they are useful to each other.

1 Like