Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_nostr-rs-relay_8
Events: 50000, Workers: 24, Duration: 1m0s
1764801836806913ℹ️ migrating to version 1... /build/pkg/database/migrations.go:68
1764801836806998ℹ️ migrating to version 2... /build/pkg/database/migrations.go:75
1764801836807017ℹ️ migrating to version 3... /build/pkg/database/migrations.go:82
1764801836807022ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:304
1764801836807029ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:349
1764801836807042ℹ️ migrating to version 4... /build/pkg/database/migrations.go:89
1764801836807046ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:357
1764801836807056ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:446
1764801836807061ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:555
1764801836807076ℹ️ migrating to version 5... /build/pkg/database/migrations.go:96
1764801836807081ℹ️ re-encoding events with optimized tag binary format... /build/pkg/database/migrations.go:562
1764801836807094ℹ️ found 0 events with e/p tags to re-encode /build/pkg/database/migrations.go:649
1764801836807124ℹ️ no events need re-encoding /build/pkg/database/migrations.go:652
1764801836807178ℹ️ migrating to version 6... /build/pkg/database/migrations.go:103
1764801836807185ℹ️ converting events to compact serial-reference format... /build/pkg/database/migrations.go:706
1764801836807242ℹ️ found 0 events to convert to compact format /build/pkg/database/migrations.go:846
1764801836807283ℹ️ no events need conversion /build/pkg/database/migrations.go:849

╔════════════════════════════════════════════════════════╗
║         BADGER BACKEND BENCHMARK SUITE                 ║
╚════════════════════════════════════════════════════════╝

=== Starting Badger benchmark ===
RunPeakThroughputTest (Badger)..

=== Peak Throughput Test ===
2025/12/03 22:43:56 INFO: Successfully loaded embedded libsecp256k1 v5.0.0 from /tmp/orly-libsecp256k1/libsecp256k1.so
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 2.911273959s
Events/sec: 17174.61
Avg latency: 1.281647ms
P90 latency: 1.626819ms
P95 latency: 1.836808ms
P99 latency: 3.758588ms
Bottom 10% Avg latency: 742.249µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 292.272251ms
Burst completed: 5000 events in 287.701125ms
Burst completed: 5000 events in 286.616429ms
Burst completed: 5000 events in 293.830439ms
Burst completed: 5000 events in 301.388252ms
Burst completed: 5000 events in 287.188158ms
Burst completed: 5000 events in 263.711266ms
Burst completed: 5000 events in 318.616274ms
Burst completed: 5000 events in 310.007309ms
Burst completed: 5000 events in 273.375973ms
Burst test completed: 50000 events in 7.922605603s, errors: 0
Events/sec: 6311.06
Wiping database between tests...
RunMixedReadWriteTest (Badger)..

=== Mixed Read/Write Test ===
Generating 1000 unique synthetic events (minimum 300 bytes each)...
Generated 1000 events:
  Average content size: 312 bytes
  All events are unique (incremental timestamps)
  All events are properly signed

Pre-populating database for read tests...
Generating 50000 unique synthetic events (minimum 300 bytes each)...
Generated 50000 events:
  Average content size: 314 bytes
  All events are unique (incremental timestamps)
  All events are properly signed

Mixed test completed: 25000 writes, 25000 reads in 24.449120282s
Combined ops/sec: 2045.06
Wiping database between tests...
RunQueryTest (Badger)..

=== Query Test ===
Generating 10000 unique synthetic events (minimum 300 bytes each)...
Generated 10000 events:
  Average content size: 313 bytes
  All events are unique (incremental timestamps)
  All events are properly signed

Pre-populating database with 10000 events for query tests...
Query test completed: 417600 queries in 1m0.004478253s
Queries/sec: 6959.48
Avg query latency: 2.151151ms
P95 query latency: 8.027278ms
P99 query latency: 12.154981ms
Wiping database between tests...
RunConcurrentQueryStoreTest (Badger)..

=== Concurrent Query/Store Test ===
Generating 5000 unique synthetic events (minimum 300 bytes each)...
Generated 5000 events:
  Average content size: 313 bytes
  All events are unique (incremental timestamps)
  All events are properly signed

Pre-populating database with 5000 events for concurrent query/store test...
Generating 50000 unique synthetic events (minimum 300 bytes each)...
Generated 50000 events:
  Average content size: 314 bytes
  All events are unique (incremental timestamps)
  All events are properly signed

Concurrent test completed: 317282 operations (267282 queries, 50000 writes) in 1m0.002851777s
Operations/sec: 5287.78
Avg latency: 1.438019ms
Avg query latency: 1.509815ms
Avg write latency: 1.054223ms
P95 latency: 3.604275ms
P99 latency: 8.983541ms

=== Badger benchmark completed ===


================================================================================
BENCHMARK REPORT
================================================================================

Test: Peak Throughput
Duration: 2.911273959s
Total Events: 50000
Events/sec: 17174.61
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 127 MB
Avg Latency: 1.281647ms
P90 Latency: 1.626819ms
P95 Latency: 1.836808ms
P99 Latency: 3.758588ms
Bottom 10% Avg Latency: 742.249µs
----------------------------------------

Test: Burst Pattern
Duration: 7.922605603s
Total Events: 50000
Events/sec: 6311.06
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 207 MB
Avg Latency: 1.260479ms
P90 Latency: 1.672696ms
P95 Latency: 1.893887ms
P99 Latency: 3.384445ms
Bottom 10% Avg Latency: 627.786µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.449120282s
Total Events: 50000
Events/sec: 2045.06
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 160 MB
Avg Latency: 393.867µs
P90 Latency: 827.906µs
P95 Latency: 922.647µs
P99 Latency: 1.157515ms
Bottom 10% Avg Latency: 1.038892ms
----------------------------------------

Test: Query Performance
Duration: 1m0.004478253s
Total Events: 417600
Events/sec: 6959.48
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 205 MB
Avg Latency: 2.151151ms
P90 Latency: 6.525088ms
P95 Latency: 8.027278ms
P99 Latency: 12.154981ms
Bottom 10% Avg Latency: 8.836851ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.002851777s
Total Events: 317282
Events/sec: 5287.78
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 168 MB
Avg Latency: 1.438019ms
P90 Latency: 2.919631ms
P95 Latency: 3.604275ms
P99 Latency: 8.983541ms
Bottom 10% Avg Latency: 5.142371ms
----------------------------------------

Report saved to: /tmp/benchmark_nostr-rs-relay_8/benchmark_report.txt
AsciiDoc report saved to: /tmp/benchmark_nostr-rs-relay_8/benchmark_report.adoc

RELAY_NAME: nostr-rs-relay
RELAY_URL: ws://nostr-rs-relay:8080
TEST_TIMESTAMP: 2025-12-03T22:47:13+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
