-
Notifications
You must be signed in to change notification settings - Fork 43
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
+7,557
−0
Merged
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 ac3bba3
Add example data
MarcoPolo dcd44bf
Fix example data
MarcoPolo cd66695
Extend example data
MarcoPolo b75cb3b
Add dashboard link
MarcoPolo 343b2e5
Update readme
MarcoPolo 3e45f54
Update readme
MarcoPolo 8d94c83
Remove wrong schema file
MarcoPolo 22bb337
feat: add basic provision script for client and server perf
mxinden 2d36ba1
Check in .terraform.lock.hcl
mxinden 7fa9f82
Spin up server in us-west-1 and client in us-east-1
mxinden 9361069
feat: introduce runner
mxinden 7358746
fix(.gitignore): don't include public keys
mxinden 8545b01
Minor refactorings
mxinden 2abcf7b
Small addition to perf readme
mxinden 4f2d7f9
Introduce download and upload benchmarks
mxinden f0e98f6
Add Go impl
MarcoPolo 16dfcc1
Run client in host network
mxinden 32699db
Add Golang docker image to runner
mxinden 2f3c425
fix(go): only print final result to stdout
mxinden c9f12ec
fix(go): use si units (i.e. here s)
mxinden 99b2f46
Provide server peer id to client
mxinden 43500ef
Use entrypoint convention and provide secret key seed
mxinden e0fa1f4
Update to latest container images
mxinden 4f207d6
Remove stray println
MarcoPolo 8229e2b
Seed Go secret key from command line and fix server invocation
mxinden 9038224
Start server image based on client image
mxinden 7ab94c8
Set new golang image
mxinden 2433338
Bump UDP receive buffer
mxinden 2480f04
Update to latest rust image using tokio
mxinden e5d6b55
chore: update the link to the interop dashboard [skip ci]
github-actions[bot] ab88ee6
fix(versions): disable webrtc tests (#160)
mxinden f29026c
chore: update the link to the interop dashboard [skip ci]
github-actions[bot] 87be6b7
Fix: Correctly abort process on timeout (#162)
MarcoPolo aa227bf
chore: update the link to the interop dashboard [skip ci]
github-actions[bot] 61ad33a
Sanitize name before saving to compose file (#164)
MarcoPolo 31349d3
chore: update the link to the interop dashboard [skip ci]
github-actions[bot] e7728b6
Cache images slightly differently (#165)
MarcoPolo 70169e6
chore: update the link to the interop dashboard [skip ci]
github-actions[bot] 5ad7338
Update readme
MarcoPolo 31c6da5
Always build when doing npm run start
MarcoPolo 2ce3daa
Save benchmark results
MarcoPolo 95cc2af
Add implementation
MarcoPolo ce6f969
Change to m5n.8xlarge with 25 Gbit
mxinden bbde59e
Update to latest rust container image
mxinden 7baa39c
Add changes for zig-libp2p
MarcoPolo 0a8c201
Test 100MiB
MarcoPolo 5d01b2a
Add **very** basic Go HTTPS implementation
mxinden d559bb3
Fix versions.ts adding sha256: to other images
mxinden 0dbdf2d
Update rust to set tcp nodelay on server
mxinden 32bcc2a
fix(https): don't randomize before write
mxinden 2cceb89
fix(go-libp2p-perf): return error
mxinden fc32953
Update versions.ts
MarcoPolo 41ec5fe
Add hack
MarcoPolo 8c58889
Build and transfer docker image
mxinden 9686211
Remove server entry point in favor of --run-server flag
mxinden 760b241
Allow ICMP to test MTU
mxinden 02d5c2b
Merge branch 'master' of https://github.com/libp2p/test-plans into pe…
mxinden efe7f6e
Move perf-dashboard to perf/dashboard
mxinden 75d7634
Adjust single connection benchmark behavior
mxinden 274e62b
Commit benchmark-results.json
mxinden 6dfb186
Don't ignore unit
mxinden a265a2d
Measure connection establishment + 1 byte round trip latencies
mxinden 0732aa8
Fix units
mxinden 618805c
Fix unit again
mxinden c2831cc
Rename ssh key from mxinden to perf
mxinden fb214bc
Pass IP and not multiaddr to client binary
mxinden 00cd434
Build on machines & run outside of Docker
mxinden d1b7d00
fix(perf/https): use duration Seconds()
mxinden 17a0d1d
fix(perf/go-libp2p): use duration Seconds()
mxinden 1f87937
fix: use uint64 for command line flags
mxinden 14cde8c
Move schema tool and remove test data
mxinden 6ef0d6c
Remove commented out code
mxinden b21af98
Improve perf/README
mxinden fa41f02
Replace RSA with eliptic curve
mxinden e1d6810
Increase iterations and commit results
mxinden 2964b82
Document command line flags in perf/README
mxinden 1498fc1
Remove perf/dashboard
mxinden 909217e
Remove --n-times flag
mxinden 0e7c64e
Rename rust-libp2p v0.51 to v0.52
mxinden 6fa2b00
Add rust-libp2p v0.52-quinn based on upstream quinn
mxinden 9ed7f1a
Add quic-go v0.34
mxinden d6a7cd1
simplify code for the HTTPS perf impl
marten-seemann eff32de
Run ping and iperf and commit results
mxinden 8ff591f
Move rust-libp2p quinn from being different version to different impl…
mxinden 9b3d61a
fix(quic-go): use upstream
mxinden a91159b
Have rsync adhere to .gitignore
mxinden c5de2c7
Change implementation output format
mxinden b1408bd
Update benchmark-results.json
mxinden ce94834
Fix field names
mxinden 388886f
fix(go-libp2p): use tls only
mxinden 23ed486
List results last
mxinden fd8a878
fix(runner): trust ssh host key
mxinden e1a49da
fix(go-libp2p): don't wait for identify round trip
mxinden 89302ef
fix(quic-go): update to latest upstream
mxinden c05e6d6
Udate benchmark results json
mxinden 9ad921e
fix(go-libp2p): don't wait for identify when dialing
mxinden 71fde9d
Add comments
mxinden 28c590b
Parse --server-address in client mode
mxinden d2d1c2b
Log building implementations on servers
mxinden f6b968a
fix(go-libp2p): use NewWithoutDefaults to disable Noise
mxinden 2cca4a0
Commit latest results
mxinden File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
* 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... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Util | ||
|
||
Helper to generate schemas for benchmark data. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that is correct (and I think makes it more clear)