Libp2p-perf - iperf equivalent for the libp2p ecosystem

I wondered how much data one could push through a single multiplexed stream. Inspired by iperf I wrote the equivalent for the libp2p ecosystem – libp2p-perf.

In a nutshell a client sends as much data as possible through a single multiplexed stream to a server which reads and discards all received data. The client closes the stream after 10 seconds. Subsequently both the client and the server print the result as the total number of bytes transferred and the corresponding bandwidth on stdout.

I wrote a Rust and a Golang implementation. JS / C++ / Java / Python / … contributions as well as contributions to the existing implementations are welcome!

Thus far I have used this tool to measure throughput within the same machine, as well as to create CPU and memory profiles. I plan to do more in-depth wide-area-network testing.

Take the numbers with a grain of salt. This code is not peer reviewed nor heavily optimized. See the measurements as a reference point of where we might be, helping to get a grasp of where we might want to go.

A similar project out there is libp2p-perf-test.

2 Likes