Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(perf): add (provision, build, run) tooling #163

Merged
merged 102 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
a26aada
WIP readme with thoughts
MarcoPolo Mar 16, 2023
ac3bba3
Add example data
MarcoPolo Mar 21, 2023
dcd44bf
Fix example data
MarcoPolo Mar 21, 2023
cd66695
Extend example data
MarcoPolo Mar 22, 2023
b75cb3b
Add dashboard link
MarcoPolo Mar 22, 2023
343b2e5
Update readme
MarcoPolo Mar 22, 2023
3e45f54
Update readme
MarcoPolo Mar 22, 2023
8d94c83
Remove wrong schema file
MarcoPolo Mar 24, 2023
22bb337
feat: add basic provision script for client and server perf
mxinden Apr 3, 2023
2d36ba1
Check in .terraform.lock.hcl
mxinden Apr 6, 2023
7fa9f82
Spin up server in us-west-1 and client in us-east-1
mxinden Apr 6, 2023
9361069
feat: introduce runner
mxinden Apr 8, 2023
7358746
fix(.gitignore): don't include public keys
mxinden Apr 8, 2023
8545b01
Minor refactorings
mxinden Apr 8, 2023
2abcf7b
Small addition to perf readme
mxinden Apr 8, 2023
4f2d7f9
Introduce download and upload benchmarks
mxinden Apr 11, 2023
f0e98f6
Add Go impl
MarcoPolo Apr 12, 2023
16dfcc1
Run client in host network
mxinden Apr 12, 2023
32699db
Add Golang docker image to runner
mxinden Apr 12, 2023
2f3c425
fix(go): only print final result to stdout
mxinden Apr 12, 2023
c9f12ec
fix(go): use si units (i.e. here s)
mxinden Apr 12, 2023
99b2f46
Provide server peer id to client
mxinden Apr 12, 2023
43500ef
Use entrypoint convention and provide secret key seed
mxinden Apr 12, 2023
e0fa1f4
Update to latest container images
mxinden Apr 12, 2023
4f207d6
Remove stray println
MarcoPolo Apr 12, 2023
8229e2b
Seed Go secret key from command line and fix server invocation
mxinden Apr 13, 2023
9038224
Start server image based on client image
mxinden Apr 13, 2023
7ab94c8
Set new golang image
mxinden Apr 13, 2023
2433338
Bump UDP receive buffer
mxinden Apr 13, 2023
2480f04
Update to latest rust image using tokio
mxinden Apr 13, 2023
e5d6b55
chore: update the link to the interop dashboard [skip ci]
github-actions[bot] Mar 20, 2023
ab88ee6
fix(versions): disable webrtc tests (#160)
mxinden Apr 4, 2023
f29026c
chore: update the link to the interop dashboard [skip ci]
github-actions[bot] Apr 4, 2023
87be6b7
Fix: Correctly abort process on timeout (#162)
MarcoPolo Apr 8, 2023
aa227bf
chore: update the link to the interop dashboard [skip ci]
github-actions[bot] Apr 8, 2023
61ad33a
Sanitize name before saving to compose file (#164)
MarcoPolo Apr 8, 2023
31349d3
chore: update the link to the interop dashboard [skip ci]
github-actions[bot] Apr 8, 2023
e7728b6
Cache images slightly differently (#165)
MarcoPolo Apr 11, 2023
70169e6
chore: update the link to the interop dashboard [skip ci]
github-actions[bot] Apr 11, 2023
5ad7338
Update readme
MarcoPolo Apr 13, 2023
31c6da5
Always build when doing npm run start
MarcoPolo Apr 13, 2023
2ce3daa
Save benchmark results
MarcoPolo Apr 13, 2023
95cc2af
Add implementation
MarcoPolo Apr 13, 2023
ce6f969
Change to m5n.8xlarge with 25 Gbit
mxinden Apr 14, 2023
bbde59e
Update to latest rust container image
mxinden Apr 14, 2023
7baa39c
Add changes for zig-libp2p
MarcoPolo Apr 14, 2023
0a8c201
Test 100MiB
MarcoPolo Apr 14, 2023
5d01b2a
Add **very** basic Go HTTPS implementation
mxinden Apr 14, 2023
d559bb3
Fix versions.ts adding sha256: to other images
mxinden Apr 14, 2023
0dbdf2d
Update rust to set tcp nodelay on server
mxinden Apr 14, 2023
32bcc2a
fix(https): don't randomize before write
mxinden Apr 14, 2023
2cceb89
fix(go-libp2p-perf): return error
mxinden Apr 14, 2023
fc32953
Update versions.ts
MarcoPolo Apr 15, 2023
41ec5fe
Add hack
MarcoPolo Apr 15, 2023
8c58889
Build and transfer docker image
mxinden Apr 24, 2023
9686211
Remove server entry point in favor of --run-server flag
mxinden Apr 24, 2023
760b241
Allow ICMP to test MTU
mxinden Apr 24, 2023
02d5c2b
Merge branch 'master' of https://github.com/libp2p/test-plans into pe…
mxinden Apr 24, 2023
efe7f6e
Move perf-dashboard to perf/dashboard
mxinden Apr 24, 2023
75d7634
Adjust single connection benchmark behavior
mxinden Apr 24, 2023
274e62b
Commit benchmark-results.json
mxinden Apr 27, 2023
6dfb186
Don't ignore unit
mxinden Apr 28, 2023
a265a2d
Measure connection establishment + 1 byte round trip latencies
mxinden Apr 28, 2023
0732aa8
Fix units
mxinden Apr 28, 2023
618805c
Fix unit again
mxinden Apr 28, 2023
c2831cc
Rename ssh key from mxinden to perf
mxinden May 1, 2023
fb214bc
Pass IP and not multiaddr to client binary
mxinden May 1, 2023
00cd434
Build on machines & run outside of Docker
mxinden May 4, 2023
d1b7d00
fix(perf/https): use duration Seconds()
mxinden May 8, 2023
17a0d1d
fix(perf/go-libp2p): use duration Seconds()
mxinden May 8, 2023
1f87937
fix: use uint64 for command line flags
mxinden May 8, 2023
14cde8c
Move schema tool and remove test data
mxinden May 8, 2023
6ef0d6c
Remove commented out code
mxinden May 8, 2023
b21af98
Improve perf/README
mxinden May 8, 2023
fa41f02
Replace RSA with eliptic curve
mxinden May 8, 2023
e1d6810
Increase iterations and commit results
mxinden May 10, 2023
2964b82
Document command line flags in perf/README
mxinden May 11, 2023
1498fc1
Remove perf/dashboard
mxinden May 11, 2023
909217e
Remove --n-times flag
mxinden May 11, 2023
0e7c64e
Rename rust-libp2p v0.51 to v0.52
mxinden May 11, 2023
6fa2b00
Add rust-libp2p v0.52-quinn based on upstream quinn
mxinden May 11, 2023
9ed7f1a
Add quic-go v0.34
mxinden May 12, 2023
d6a7cd1
simplify code for the HTTPS perf impl
marten-seemann May 15, 2023
eff32de
Run ping and iperf and commit results
mxinden May 17, 2023
8ff591f
Move rust-libp2p quinn from being different version to different impl…
mxinden May 17, 2023
9b3d61a
fix(quic-go): use upstream
mxinden May 18, 2023
a91159b
Have rsync adhere to .gitignore
mxinden May 19, 2023
c5de2c7
Change implementation output format
mxinden May 19, 2023
b1408bd
Update benchmark-results.json
mxinden May 19, 2023
ce94834
Fix field names
mxinden May 19, 2023
388886f
fix(go-libp2p): use tls only
mxinden May 23, 2023
23ed486
List results last
mxinden May 23, 2023
fd8a878
fix(runner): trust ssh host key
mxinden May 24, 2023
e1a49da
fix(go-libp2p): don't wait for identify round trip
mxinden May 24, 2023
89302ef
fix(quic-go): update to latest upstream
mxinden May 24, 2023
c05e6d6
Udate benchmark results json
mxinden May 24, 2023
9ad921e
fix(go-libp2p): don't wait for identify when dialing
mxinden May 24, 2023
71fde9d
Add comments
mxinden May 24, 2023
28c590b
Parse --server-address in client mode
mxinden May 24, 2023
d2d1c2b
Log building implementations on servers
mxinden May 24, 2023
f6b968a
fix(go-libp2p): use NewWithoutDefaults to disable Noise
mxinden May 24, 2023
2cca4a0
Commit latest results
mxinden May 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions perf/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
GO_SUBDIRS := $(wildcard impl/go/*/.)
RUST_SUBDIRS := $(wildcard impl/rust/*/.)
ZIG_SUBDIRS := $(wildcard impl/zig/*/.)
HTTPS_SUBDIRS := $(wildcard impl/https/.)

all: $(GO_SUBDIRS) $(RUST_SUBDIRS) $(ZIG_SUBDIRS) $(HTTPS_SUBDIRS)
$(GO_SUBDIRS):
$(MAKE) -C $@
$(RUST_SUBDIRS):
$(MAKE) -C $@
$(ZIG_SUBDIRS):
$(MAKE) -C $@
$(HTTPS_SUBDIRS):
$(MAKE) -C $@


.PHONY: $(GO_SUBDIRS) $(RUST_SUBDIRS) $(ZIG_SUBDIRS) $(HTTPS_SUBDIRS) all
18 changes: 18 additions & 0 deletions perf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# libp2p perf testing

## Setup

1. `cd terraform`
2. Save your public SSH key as the file `./user.pub`.
3. `terraform init`
4. `terraform apply`

## Execute

1. `cd runner`
2. `npm ci`
3. `npm run start -- --client-public-ip $(terraform output -raw -state ../terraform/terraform.tfstate client_public_ip) --server-public-ip $(terraform output -raw -state ../terraform/terraform.tfstate server_public_ip)`

## Add benchmark binary

See `runner/src/versions.ts`.
62 changes: 62 additions & 0 deletions perf/dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Perf Dashboard [wip]

This is an outline of what I'd like to see our perf dashboard look like.

A lot of this is inspired by the [MsQuic
dashboard](https://microsoft.github.io/msquic/). Please look at that first.

For each combination of libp2p implementation, version, and transport we would
have numbers that outline:
1. Download/Upload throughput
2. Request latency
3. Requests per second (for some request/response protocol)
4. Handshakes per second (useful to identify overhead in connection
initialization).
5. Memory usage.

The y axis on the graphs is the value for the above tests, the x axis is the
specific version. Different lines represent different implementation+transports.

The dashboards should be selectable and filterable.

# Other transports (iperf/http)

We have to be careful to compare apples to apples. A raw iperf number might be
confusing here because no application will ever hit those numbers since they
will at least want some encryption in their connection. I would suggest not
having this or an HTTP comparison. Having HTTPS might be okay.

# Example dashboard

https://observablehq.com/@realmarcopolo/libp2p-perf

The dashboard automatically pulls data from this repo to display it.

It currently pulls example-data.json. The schema of this data is defined in
`benchmarks.schema.json` and `benchmark-result-type.ts`.

# Benchmark runner

This is the thing that runs the benchmark binaries and produces the benchmark
data (that matches the benchmarks.schema.json/benchmark-result-type.ts)

# Benchmark binary

This is per implementation. It's a binary that accepts the following flags:

| Flag | description |
| -------------------- | ------------------------------------------------------ |
| parallel_connections | number of parallel connections to use |
| upload_bytes | number of bytes to upload to server per connection |
| download_bytes | number of bytes to download from server per connection |
| n_times | number of times to do the perf round trip |
| close_connection | bool. Close the connection after a perf round trip |

The binary should report the following:

* Stats on the length of the run:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Stats on the length of the run:
* Stats on the durations of the `n_times` runs:

I assume that is correct (and I think makes it more clear)

* Total, Avg, Min, Max, p95
* Round trips per second:
* Avg, Min, Max, p95
mxinden marked this conversation as resolved.
Show resolved Hide resolved
mxinden marked this conversation as resolved.
Show resolved Hide resolved

Maybe more? TODO...
25 changes: 25 additions & 0 deletions perf/dashboard/benchmark-result-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
export type BenchmarkResults = {
benchmarks: Benchmark[],
// For referencing this schema in JSON
"$schema"?: string
};

export type Benchmark = {
name: string,
unit: "bits/s" | "s",
results: Result[],
comparisons: Comparison[],

}

export type Result = {
result: number,
implementation: string,
transportStack: string,
version: string
};

export type Comparison = {
name: string,
result: number,
}
98 changes: 98 additions & 0 deletions perf/dashboard/benchmarks.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/BenchmarkResults",
"definitions": {
"BenchmarkResults": {
"type": "object",
"properties": {
"benchmarks": {
"type": "array",
"items": {
"$ref": "#/definitions/Benchmark"
}
},
"$schema": {
"type": "string"
}
},
"required": [
"benchmarks"
],
"additionalProperties": false
},
"Benchmark": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"unit": {
"type": "string",
"enum": [
"bits/s",
"s"
]
},
"results": {
"type": "array",
"items": {
"$ref": "#/definitions/Result"
}
},
"comparisons": {
"type": "array",
"items": {
"$ref": "#/definitions/Comparison"
}
}
},
"required": [
"name",
"unit",
"results",
"comparisons"
],
"additionalProperties": false
},
"Result": {
"type": "object",
"properties": {
"result": {
"type": "number"
},
"implementation": {
"type": "string"
},
"transportStack": {
"type": "string"
},
"version": {
"type": "string"
}
},
"required": [
"result",
"implementation",
"transportStack",
"version"
],
"additionalProperties": false
},
"Comparison": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"result": {
"type": "number"
}
},
"required": [
"name",
"result"
],
"additionalProperties": false
}
}
}
161 changes: 161 additions & 0 deletions perf/dashboard/example-data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"$schema": "./benchmarks.schema.json",
"benchmarks": [
{
"name": "Single Connection throughput – Upload",
"unit": "bits/s",
"comparisons": [
{
"name": "http",
"result": 1234
}
],
"results": [
{
"result": 1100,
"implementation": "go-libp2p",
"transportStack": "quic-v1",
"version": "v0.24.2"
},
{
"result": 1000,
"implementation": "go-libp2p",
"transportStack": "quic-v1",
"version": "v0.25.1"
},
{
"result": 8234,
"implementation": "go-libp2p",
"transportStack": "quic-v1",
"version": "v0.26.2"
},
{
"result": 4000,
"implementation": "rust-libp2p",
"transportStack": "quic-v1",
"version": "v0.50.0"
},
{
"result": 8000,
"implementation": "rust-libp2p",
"transportStack": "quic-v1",
"version": "v0.51.0"
},
{
"result": 6000,
"implementation": "rust-libp2p",
"transportStack": "quic-v1",
"version": "v0.52.0"
},
{
"result": 9001,
"implementation": "zig-libp2p",
"transportStack": "quic-v1",
"version": "v0.0.1"
},
{
"result": 9002,
"implementation": "zig-libp2p",
"transportStack": "quic-v1",
"version": "v0.0.2"
},
{
"result": 201,
"implementation": "js-libp2p",
"transportStack": "tcp+noise+yamux",
"version": "v0.41.0"
},
{
"result": 302,
"implementation": "js-libp2p",
"transportStack": "tcp+noise+yamux",
"version": "v0.42.0"
},
{
"result": 501,
"implementation": "js-libp2p",
"transportStack": "tcp+noise+yamux",
"version": "v0.43.0"
}
]
},
{
"name": "Single Connection 1 byte round trip latency",
"unit": "s",
"comparisons": [
{
"name": "http",
"result": 1.234
}
],
"results": [
{
"result": 0.100,
"implementation": "go-libp2p",
"transportStack": "quic-v1",
"version": "v0.24.2"
},
{
"result": 0.100,
"implementation": "go-libp2p",
"transportStack": "quic-v1",
"version": "v0.25.1"
},
{
"result": 0.834,
"implementation": "go-libp2p",
"transportStack": "quic-v1",
"version": "v0.26.2"
},
{
"result": 0.400,
"implementation": "rust-libp2p",
"transportStack": "quic-v1",
"version": "v0.50.0"
},
{
"result": 0.800,
"implementation": "rust-libp2p",
"transportStack": "quic-v1",
"version": "v0.51.0"
},
{
"result": 0.600,
"implementation": "rust-libp2p",
"transportStack": "quic-v1",
"version": "v0.52.0"
},
{
"result": 0.901,
"implementation": "zig-libp2p",
"transportStack": "quic-v1",
"version": "v0.0.1"
},
{
"result": 0.902,
"implementation": "zig-libp2p",
"transportStack": "quic-v1",
"version": "v0.0.2"
},
{
"result": 0.201,
"implementation": "js-libp2p",
"transportStack": "tcp+noise+yamux",
"version": "v0.41.0"
},
{
"result": 0.302,
"implementation": "js-libp2p",
"transportStack": "tcp+noise+yamux",
"version": "v0.42.0"
},
{
"result": 0.501,
"implementation": "js-libp2p",
"transportStack": "tcp+noise+yamux",
"version": "v0.43.0"
}
]
}
]
}
1 change: 1 addition & 0 deletions perf/dashboard/util/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
3 changes: 3 additions & 0 deletions perf/dashboard/util/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Util

Helper to generate schemas for benchmark data.
Loading