mirror of
https://github.com/vacp2p/libp2p-test-plans.git
synced 2026-01-09 21:38:03 -05:00
This project includes the following components: - `terraform/`: a Terraform scripts to provision infrastructure - `impl/`: implementations of the [libp2p perf protocol](https://github.com/libp2p/specs/blob/master/perf/perf.md) running on top of e.g. go-libp2p, rust-libp2p or Go's std-library https stack - `runner/`: a set of scripts building and running the above implementations on the above infrastructure, reporting the results in `benchmark-results.json` Benchmark results can be visualized with https://observablehq.com/@mxinden-workspace/libp2p-performance-dashboard. Co-authored-by: Marco Munizaga <git@marcopolo.io> Co-authored-by: Marten Seemann <martenseemann@gmail.com> Co-authored-by: Piotr Galar <piotr.galar@gmail.com>
2.4 KiB
2.4 KiB
libp2p performance benchmarking
This project includes the following components:
terraform/: a Terraform scripts to provision infrastructureimpl/: implementations of the libp2p perf protocol running on top of e.g. go-libp2p, rust-libp2p or Go's std-library https stackrunner/: a set of scripts building and running the above implementations on the above infrastructure, reporting the results inbenchmark-results.json
Benchmark results can be visualized with https://observablehq.com/@mxinden-workspace/libp2p-performance-dashboard.
Provision infrastructure
Bootstrap
- Save your public SSH key as the file
./terraform/modules/short_lived/files/perf.pub; or generate a new key pair withmake ssh-keygenand add it to your SSH agent withmake ssh-add. cd terraform/configs/localterraform initterraform applyCLIENT_IP=$(terraform output -raw client_ip)SERVER_IP=$(terraform output -raw server_ip)
Build and run implementations
WARNING: Running the perf tests might take a while.
cd runnernpm cinpm run start -- --client-public-ip $CLIENT_IP --server-public-ip $SERVER_IP
Deprovision infrastructure
cd terraform/configs/localterraform destroy
Adding a new implementation
- Add implementation to
impl/.
- Create a folder
impl/<your-implementation-name>/<your-implementation-version>. - In that folder include a
Makefilethat builds an executable and stores it next to theMakefileunder the nameperf. - Requirements for the executable:
- Running as a libp2p-perf server
- Command line flags
--run-server
- Command line flags
- Running as a libp2p-perf client
- Input via command line
--server-ip-address--transport(seerunner/versions.tsfor possible variants)--upload-bytesnumber of bytes to upload per stream.--download-bytesnumber of bytes to download per stream.
- Output
- Logging MUST go to stderr.
- Measurement output is printed to stdout as JSON in the form of:
{"connectionEstablishedSeconds":0.246442851,"uploadSeconds":0.000002077,"downloadSeconds":0.060712241}
- Input via command line
- Running as a libp2p-perf server
- In
impl/Makefileinclude your implementation in thealltarget. - Reference implementation in
runner/src/versions.ts.