Nostr relay benchmarking tool
  • Zig 85.4%
  • Shell 11.1%
  • wisp 2.5%
  • Dockerfile 1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-06 09:46:08 -04:00
.github/workflows Move to libnostr-z 0.5.0, build with Zig 0.17, fix the Docker builds (#13) 2026-10-06 09:46:08 -04:00
configs Fix nostr-rs-relay auth config and update benchmark results 2025-12-12 16:23:24 -05:00
reports Fix benchmark fairness and update results 2025-12-16 14:08:06 -05:00
src Migrate to libnostr-z WS/relay client (drop in-tree copies) (#7) 2026-06-13 13:34:52 -04:00
.gitignore Migrate to Zig 0.16 (#4) 2026-06-12 15:21:28 -04:00
build.zig Move to libnostr-z 0.5.0, build with Zig 0.17, fix the Docker builds (#13) 2026-10-06 09:46:08 -04:00
build.zig.zon Move to libnostr-z 0.5.0, build with Zig 0.17, fix the Docker builds (#13) 2026-10-06 09:46:08 -04:00
docker-compose.ramdisk.yml docker benchmarks 2025-12-12 14:00:02 -05:00
docker-compose.yml Fix concurrent query/store test hanging with large event counts 2025-12-16 10:56:08 -05:00
Dockerfile Initial Zig nostr relay benchmark implementation 2025-12-11 21:21:28 -05:00
Dockerfile.khatru-lmdb docker benchmarks 2025-12-12 14:00:02 -05:00
Dockerfile.khatru-sqlite Fix nostr-rs-relay auth config and update benchmark results 2025-12-12 16:23:24 -05:00
Dockerfile.nostr-bench Move to libnostr-z 0.5.0, build with Zig 0.17, fix the Docker builds (#13) 2026-10-06 09:46:08 -04:00
Dockerfile.nostr-rs-relay Fix nostr-rs-relay auth config and update benchmark results 2025-12-12 16:23:24 -05:00
Dockerfile.orly Fix nostr-rs-relay auth config and update benchmark results 2025-12-12 16:23:24 -05:00
Dockerfile.relayer docker benchmarks 2025-12-12 14:00:02 -05:00
Dockerfile.strfry docker benchmarks 2025-12-12 14:00:02 -05:00
Dockerfile.wisp Move to libnostr-z 0.5.0, build with Zig 0.17, fix the Docker builds (#13) 2026-10-06 09:46:08 -04:00
LICENSE Switch license from AGPL-3.0 to MIT 2026-03-04 21:25:01 -05:00
README.md Move to libnostr-z 0.5.0, build with Zig 0.17, fix the Docker builds (#13) 2026-10-06 09:46:08 -04:00
run-benchmark.sh Fix nostr-rs-relay auth config and update benchmark results 2025-12-12 16:23:24 -05:00
setup.sh docker benchmarks 2025-12-12 14:00:02 -05:00

nostr-bench

Nostr relay benchmark tool written in Zig.

Requires Zig 0.16 or 0.17. For Zig 0.15, use the v0.1.1 release.

Build

zig build -Doptimize=ReleaseFast

Usage

# Benchmark a relay
./zig-out/bin/nostr-bench -r ws://localhost:7777

# Multiple relays
./zig-out/bin/nostr-bench -r ws://localhost:7777 -r ws://localhost:7778

# Custom parameters
./zig-out/bin/nostr-bench -r ws://localhost:7777 -e 10000 -w 8 --rate 1000

Options

-r, --relay <URL>       Relay WebSocket URL (can specify multiple)
-e, --events <N>        Number of events (default: 10000)
-w, --workers <N>       Concurrent workers (default: CPU/4)
-d, --duration <S>      Duration in seconds (default: 60)
--rate <N>              Events/sec per worker (default: 1000, 0 = unlimited)
--async                 Fire-and-forget mode
--report-file <PATH>    Write JSON report
--only-peak             Run only peak throughput test
--only-burst            Run only burst pattern test
--only-mixed            Run only mixed read/write test
--only-query            Run only query performance test
--only-concurrent       Run only concurrent query/store test

License

MIT