Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libp2p PubSub Tests Will Give Skewed Results Due To Unoptimized Setup #6

Open
bonedaddy opened this issue Jun 12, 2019 · 0 comments
Open

Comments

@bonedaddy
Copy link

bonedaddy commented Jun 12, 2019

libp2p isn't perfect, especially pubsub, however there are certains measures you can take to achieve optimal results, which don't appear to be done here. Additionally there's a lot of configuration noise that is probably not needed and will give reduced performance.

quickly reading through the test code, I believe I have spotted some room for improvements:

Static Peering + Connection Manager

It's unclear if the connection manager is being used or not used. If it is being used, with the idea being static peering there exists the possibility that connections will be pruned, possibly leading to delayed message propagation, or inadequate peer relationships.

Nat Port Map Is Racey

From what I've read the test was all done on a single machine, however even if test setups change, unless NAT is needed, don't use it as it has data races

Disable Relay

It's unclear if relay is being 100% utilized to provide circuit relay hops, or just enabling circuit relay functionality. I would probably pick to either enable circuit relay hops, or just completely disabled the relay, as if anything this will increase load on the libp2p hosts, and you wont actually be getting the benefits of circuit relay.

Enable Service Discovery (most important part)

The gossipsub specs talks about ambient service discovery, and not needing to implement service discovery within the router.

Based off my quick look, there appears to be no form of service discovery related to the pubsub rooms that peers are joining. Although in theory gossipsub will function well without it, adding service discovery for the pubsub rooms peers are joining will give much better results, and more than likely help message propagation times.

For example, the coreapi of go-ipfs does something similar to this when being provided with a Discover flag https://github.com/ipfs/go-ipfs/blob/master/core/coreapi/pubsub.go#L62

So by using service discovery, you can distribute your messages much faster, than without service discovery.

Using an entire libp2p daemon when it's not needed

go-libp2p-daemon is pretty dope, but it contains a lot of bells and whistles that aren't needed for just a test of pubsub.

You're probably better off selectively constructing your libp2p host directly, and only enabling the needed functionality.

@bonedaddy bonedaddy changed the title Libp2p PubSub Tests Will Give Skewed Results Due To Incorrect Setup Libp2p PubSub Tests Will Give Skewed Results Due To Unoptimized Setup Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant