A simple load tester for booster-http
This is a simple docker setup that uses K6 to run a series of load tests of fetching storacha content against a specified CID list:
- A Lassie Daemon for fetching content
- A Kubo Gateway URL for fetching content
- ipfs.io
- w3s.link
- pinata public gateway
- Docker Engine must be installed on the machine running load tests, along with the Docker Compose plugin. See Docker Engine installation overview
- Running Kubo Daemon for Kubo tests
- Running Lassie Daemon for Lassie tests
The load test reads configuration from environment variables in the .env file .
Before you run the load test for the first time, you should run:
$ cp .env.example .env
You will need to edit .env to set the relevant config options
e.g:
LASSIE_FETCH_URL=http://127.0.0.1:8888
KUBO_GATEWAY_URL=http://127.0.0.1:8080
IPFS_IO_URL=http://ipfs.io
W3S_URL=http://w3s.link
PINATA_GATEWAY_URL=http://gateway.pinata.cloud
These values can be determined a few ways. Kubo daemon startup output typically looks like this:
Initializing daemon...
Kubo version: 0.17.0
Repo version: 12
System version: arm64/darwin
Golang version: go1.19.1
Swarm listening on /ip4/10.0.0.8/tcp/4001
Swarm listening on /ip4/10.0.0.8/udp/4001/quic
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/127.0.0.1/udp/4001/quic
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /ip6/::1/udp/4001/quic
Swarm listening on /p2p-circuit
Swarm announcing /ip4/10.0.0.8/tcp/4001
Swarm announcing /ip4/10.0.0.8/udp/4001/quic
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/127.0.0.1/udp/4001/quic
Swarm announcing /ip6/::1/tcp/4001
Swarm announcing /ip6/::1/udp/4001/quic
API server listening on /ip4/127.0.0.1/tcp/5001
WebUI: http://127.0.0.1:5001/webui
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready
The relevant lines to pull from are API Server Listening on ...
for KUBO_API_BASE and Gateway (readonly) server listening on ...
for KUBO_GATEWAY_URL
For lassie, start the API daemon with -p
and use the values you used for port at startup.
To run a load test using the host machine's local k6 runner, run:
$ ./loadtest.sh
Your load test will display output as it runs. Once it's complete, you can view performance data in grafana, which will remain running after the load test shuts down.
Alternatively, a load test summary CSV file will also be created in the /results
directory of the project.
Early days PRs are welcome!
This library is dual-licensed under Apache 2.0 and MIT terms.
Copyright 2022. Protocol Labs, Inc.