You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ideally a node should have a healthy mix of inbound and outbound connections. As it is right now, we have no control on this, we naively try to connect to all nodes and it can happen that we end up having too many outbound connections, leaving no space for inbound connections.
Solution:
Add room in the connectivity loop for inbound peers, so we no longer end up filling our connections with only outbound ones. In nimbus this is currently done by limiting the outgoingPeers to max(node.wantedPeers div 10, 3), so if outgoingPeers > targetOutgoingPeers we don't try to connect to any outgoing peer.
Nuances:
Unsure if enforcing a 1/10 ratio outbound/inbound is the right solution for us. Allow to easily parametrize it.
There is a risk that if a given node is NotReachable it won't be able to have Inbound connections. So this node will only have targetOutgoingPeers amount of peers, hence having way less peers than other nodes. So perhaps leaving room for inbound peers should be only enforced for Reachable nodes.
The text was updated successfully, but these errors were encountered:
This is not a good strategy imo, if every peers try to dial peers until it reaches maxConnections, you will naturally have more outgoing connections than incoming connections, and that cannot work at the network scale (every outgoing connection is someone else's incoming connection)
Ideally, every node leaves > maxConnections / 2 open for incoming connections (also need to account for peers that are "outbound only" and are just using slots without giving any)
What is done in nimbus is that we only dial when we have to (while we are unhealthy), and once we are healthy, we leave all the remaining slots for incoming connections. This makes nimbus very nice to the network (ie on our fleet, we generally have ~30 outgoing connections and >200 incoming). But if we have to, we'll kick every one of this incoming connection to get healthy (in case of attack or whatev)
Ideally a node should have a healthy mix of inbound and outbound connections. As it is right now, we have no control on this, we naively try to connect to all nodes and it can happen that we end up having too many outbound connections, leaving no space for inbound connections.
Solution:
Add room in the connectivity loop for inbound peers, so we no longer end up filling our connections with only outbound ones. In nimbus this is currently done by limiting the
outgoingPeers
tomax(node.wantedPeers div 10, 3)
, so ifoutgoingPeers > targetOutgoingPeers
we don't try to connect to any outgoing peer.Nuances:
NotReachable
it won't be able to haveInbound
connections. So this node will only havetargetOutgoingPeers
amount of peers, hence having way less peers than other nodes. So perhaps leaving room for inbound peers should be only enforced forReachable
nodes.The text was updated successfully, but these errors were encountered: