How to overcome "connections per ip limit exceeded"

Hi,

Is there documentation on how to set the resource manager correctly such that “connections per ip limit exceeded” will not be reached?

The default seem to be 8.

In my use case, multiple peers use the same IP (each with its own port).
I am guessing this is why the IP based limit is reached.

Found out that I can use:

host, err := libp2p.New(
		...
                libp2p.ResourceManager(&network.NullResourceManager{}),
	)

to remove the resource manager.

The DefaultResourceManager was misbehaving for our use case.
Removing it, we no longer get neither “connections per ip limit exceeded” errors not ECONNRESET from peers!!!

Do NOT disable the rcmgr in production code.

@vyzo, thank you for your response.

  1. Is the concern about running with NullResourceManager also apply to PrivateNetwork?
  2. What is the advised alternative?
    2.1 Is it possible to configure the DefaultResourceManager? Any documentation and example how to do that?
    2.2 SHould I implement my own ResourceManager? Any documentation and example how to do that? Any skeleton I can use?

Yes, you can configure the rcmgr very precisely, although the details have changed since I worked on it.

You can also write your own implementation as well, but this may be more involved.

I dont advocate the use of pnet in general, as the protocol has a very weak security posture; if the key leaks you have to tear down the network basically.

– vyzo