Benchmarking and stress testing tools for the Filecoin decentralized storage network via the web3.storage API.
This project provides experimental benchmarking tools to evaluate Filecoin storage performance:
| Feature | Description |
|---|---|
| Upload throughput | Measures speed & latency to store data on Filecoin via web3.storage |
| Retrieval latency | Tests data retrieval speed through the w3s.link gateway |
| Concurrent stress | Simulates parallel workers to measure performance under load |
| Result visualization | Auto-generates Matplotlib charts from JSON result files |
The goal is to explore how Filecoin performs for real-world workloads such as AI dataset hosting, media distribution, and decentralized application storage.
filecoin-storage-benchmark/
β
βββ benchmark/
β βββ benchmark.py # Upload / retrieval / latency benchmark
β βββ stress_test.py # Concurrent stress test
β
βββ dashboard/
β βββ plot_results.py # Matplotlib chart generator
β
βββ results/ # JSON output files (auto-created)
β βββ README.md
β
βββ .github/
β βββ workflows/
β βββ ci.yml # Lint & import checks
β
βββ requirements.txt
βββ README.md
- Python 3.11+
- A free web3.storage account and API token
git clone https://github.com/hosammahdy91/filecoin-storage-benchmark.git
cd filecoin-storage-benchmarkpip install -r requirements.txtexport W3S_TOKEN="your_web3_storage_token_here"# Default: tests 0.5 MB, 1 MB, 5 MB files
python benchmark/benchmark.py
# Custom file sizes
python benchmark/benchmark.py --sizes 1 10 50
# More latency repetitions
python benchmark/benchmark.py --sizes 1 5 --latency-repeat 10# Default: 8 workers, 256 KB per file
python benchmark/stress_test.py
# Custom
python benchmark/stress_test.py --workers 16 --file-size-kb 512# Benchmark chart
python dashboard/plot_results.py --type benchmark
# Stress test chart
python dashboard/plot_results.py --type stressCharts are saved to dashboard/benchmark_chart.png and dashboard/stress_chart.png.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Filecoin / web3.storage Benchmark
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββ 1.0 MB βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Uploading 1.00 MB [1.0MB]
β CID: bafybeig... | 1.243s | 824.36 KB/s
β Retrieving bafybeig... [1.0MB]
β 1.00 MB | 0.412s | 2.43 MB/s
ββ Latency ββββββββββββββββββββββββββββββββββββββββββββββββββ
β± Latency test (Γ5)
β avg=398.2ms min=341.1ms max=471.6ms
β
Results saved β results/benchmark_20250314_153201.json
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Parameter | Default | Description |
|---|---|---|
--sizes |
0.5 1 5 |
File sizes in MB |
--latency-repeat |
5 |
Latency test repetitions |
--workers |
8 |
Concurrent workers |
--file-size-kb |
256 |
KB per worker file |
- AI dataset storage benchmarking
- Large media file distribution
- NFT asset and metadata storage
- Decentralized app (dApp) data hosting
- Comparing Filecoin vs centralized cloud storage
MIT Β© Hosam