-
About libp2p_stream and quic stream
I use opentelemetry to track performance analysis,
match buffered.read_exact(&mut buffer[..4]).await The delay of this sentence will fluctuate between 10ms-100ms.
My stream is built based on libp2p_Stream lib. Here is to get the stream controller.
Here I open the stream by listening and dialing. Then I operate the stream to transmit my application data between two nodes. My question now is, in addition to using libp2p_Stream lib to build custom streams to transmit data, is there a more efficient way to transmit data, such as based on quic_stream. Because there are too few tutorials related to libp2p, and most of the docs.rs do not have examples, I don’t know what to do now. Is to find another stream to replace my original libp2p_Stream lib, I'd better focus on solving the match buffered.read_exact(&mut buffer[..4]).await problem, which can help me solve the latency problem. Another problem is that I use iperf3 to test the performance of my two nodes. When they are directly connected, they can reach 30-40Mbps, but when using libp2p, they are only 2Mbps, and packets will be lost as long as they exceed 2M. Based on the above reasons, I have been wondering if my stream construction method is incorrect. Below is my Behaviour build and swarm build
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
done |
Beta Was this translation helpful? Give feedback.
-
libp2p默认会使用加密的,有一些延迟上的增加很正常。吞吐量的话尽量减少数据复制吧,比如用 |
Beta Was this translation helpful? Give feedback.
done
The implementation of ConnectionHandler and netbehaviour has been solved.