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
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.
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.
The text was updated successfully, but these errors were encountered:
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
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 aDiscover
flag https://github.com/ipfs/go-ipfs/blob/master/core/coreapi/pubsub.go#L62So 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.
The text was updated successfully, but these errors were encountered: