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
We have observed in the relay infrastructure that almost all libp2p writes are tiny. This creates a throughput and performance problem, as it results in sending many more packets than necessary, falling way short of maximum throughput as our packets are mostly empty.
In addition, the number of syscalls is elevated, which reduces software performance.
In an experiment with a relay using libp2p/go-mplex#54, it was observed that the inbound throughput increased while the outbound packet rate decreased drastically, to almost 60% of inbound packet rate.
In continuation of discussion in libp2p/go-mplex#54, I would like to propose a write coalescing component, that sits between the security module and the multiplexer Why there? it greatly reduces the overhead of the security module from the length/mac -- yes, our writes are so small that this is a real problem.
The module could be optional (eg turned on in relays only) or it could be permanent with a change in the stream interface.
The problem is that not all protocols are okay with the coalescing delay, as some of them are time-sensitive (eg: ping) or real-time.
To overcome this, the module could provide a WriteNoDelay method to be used by multiplexers, and the method could be exposed via options given at stream creation time.
In this manner, real-time protocols could create their streams with a OpenStream(NoDelay) option, thus enabling writes to this stream to avoid the coalescing delay.
This work was completed although we've recently disabled it in #867 until we've performed further testing/profiling. I am going to close this and open a new issue to track re-enabling it for mplex and yamux.
We have observed in the relay infrastructure that almost all libp2p writes are tiny. This creates a throughput and performance problem, as it results in sending many more packets than necessary, falling way short of maximum throughput as our packets are mostly empty.
In addition, the number of syscalls is elevated, which reduces software performance.
In an experiment with a relay using libp2p/go-mplex#54, it was observed that the inbound throughput increased while the outbound packet rate decreased drastically, to almost 60% of inbound packet rate.
In continuation of discussion in libp2p/go-mplex#54, I would like to propose a write coalescing component, that sits between the security module and the multiplexer Why there? it greatly reduces the overhead of the security module from the length/mac -- yes, our writes are so small that this is a real problem.
The module could be optional (eg turned on in relays only) or it could be permanent with a change in the stream interface.
The problem is that not all protocols are okay with the coalescing delay, as some of them are time-sensitive (eg: ping) or real-time.
To overcome this, the module could provide a
WriteNoDelay
method to be used by multiplexers, and the method could be exposed via options given at stream creation time.In this manner, real-time protocols could create their streams with a
OpenStream(NoDelay)
option, thus enabling writes to this stream to avoid the coalescing delay.cc @Stebalien @whyrusleeping @raulk @marten-seemann
The text was updated successfully, but these errors were encountered: