Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_nostr-rs-relay_8
Events: 50000, Workers: 24, Duration: 1m0s
1764846517510492ℹ️ migrating to version 1... /build/pkg/database/migrations.go:68
1764846517510692ℹ️ migrating to version 2... /build/pkg/database/migrations.go:75
1764846517511210ℹ️ migrating to version 3... /build/pkg/database/migrations.go:82
1764846517511251ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:304
1764846517511274ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:349
1764846517511304ℹ️ migrating to version 4... /build/pkg/database/migrations.go:89
1764846517511317ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:357
1764846517511329ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:446
1764846517511340ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:555
1764846517511366ℹ️ migrating to version 5... /build/pkg/database/migrations.go:96
1764846517511373ℹ️ re-encoding events with optimized tag binary format... /build/pkg/database/migrations.go:562
1764846517511388ℹ️ found 0 events with e/p tags to re-encode /build/pkg/database/migrations.go:649
1764846517511394ℹ️ no events need re-encoding /build/pkg/database/migrations.go:652
1764846517511443ℹ️ migrating to version 6... /build/pkg/database/migrations.go:103
1764846517511452ℹ️ converting events to compact serial-reference format... /build/pkg/database/migrations.go:706
1764846517511466ℹ️ found 0 events to convert to compact format /build/pkg/database/migrations.go:846
1764846517511472ℹ️ no events need conversion /build/pkg/database/migrations.go:849

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

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

=== Peak Throughput Test ===
2025/12/04 11:08:37 INFO: Successfully loaded embedded libsecp256k1 v5.0.0 from /tmp/orly-libsecp256k1/libsecp256k1.so
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 4.118969633s
Events/sec: 12138.96
Avg latency: 1.937994ms
P90 latency: 2.852802ms
P95 latency: 3.444328ms
P99 latency: 5.727836ms
Bottom 10% Avg latency: 946.456µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 403.020917ms
Burst completed: 5000 events in 372.371612ms
Burst completed: 5000 events in 424.238707ms
Burst completed: 5000 events in 385.317421ms
Burst completed: 5000 events in 516.841571ms
Burst completed: 5000 events in 591.703187ms
Burst completed: 5000 events in 445.314485ms
Burst completed: 5000 events in 374.011153ms
Burst completed: 5000 events in 398.6942ms
Burst completed: 5000 events in 365.965806ms
Burst test completed: 50000 events in 9.28457886s, errors: 0
Events/sec: 5385.27
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.684808581s
Combined ops/sec: 2025.54
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: 251672 queries in 1m0.006178379s
Queries/sec: 4194.10
Avg query latency: 4.01666ms
P95 query latency: 15.051188ms
P99 query latency: 22.451758ms
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: 219001 operations (169001 queries, 50000 writes) in 1m0.004144652s
Operations/sec: 3649.76
Avg latency: 2.620549ms
Avg query latency: 2.844617ms
Avg write latency: 1.863195ms
P95 latency: 7.482377ms
P99 latency: 20.396275ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 4.118969633s
Total Events: 50000
Events/sec: 12138.96
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 150 MB
Avg Latency: 1.937994ms
P90 Latency: 2.852802ms
P95 Latency: 3.444328ms
P99 Latency: 5.727836ms
Bottom 10% Avg Latency: 946.456µs
----------------------------------------

Test: Burst Pattern
Duration: 9.28457886s
Total Events: 50000
Events/sec: 5385.27
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 259 MB
Avg Latency: 2.040218ms
P90 Latency: 3.113648ms
P95 Latency: 3.901749ms
P99 Latency: 6.623842ms
Bottom 10% Avg Latency: 930.455µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.684808581s
Total Events: 50000
Events/sec: 2025.54
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 170 MB
Avg Latency: 435.806µs
P90 Latency: 909.692µs
P95 Latency: 1.063135ms
P99 Latency: 1.414473ms
Bottom 10% Avg Latency: 1.173081ms
----------------------------------------

Test: Query Performance
Duration: 1m0.006178379s
Total Events: 251672
Events/sec: 4194.10
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 159 MB
Avg Latency: 4.01666ms
P90 Latency: 11.874709ms
P95 Latency: 15.051188ms
P99 Latency: 22.451758ms
Bottom 10% Avg Latency: 16.47537ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.004144652s
Total Events: 219001
Events/sec: 3649.76
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 154 MB
Avg Latency: 2.620549ms
P90 Latency: 5.591506ms
P95 Latency: 7.482377ms
P99 Latency: 20.396275ms
Bottom 10% Avg Latency: 10.345145ms
----------------------------------------

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-04T11:11:56+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
