Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_relayer-basic_8
Events: 50000, Workers: 24, Duration: 1m0s
1763655980207009ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763655980207065ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763655980207089ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763655980207095ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287
1763655980207103ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332
1763655980207116ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763655980207120ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340
1763655980207133ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429
1763655980207139ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:538

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

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

=== Peak Throughput Test ===
2025/11/20 16:26:20 WARN: Failed to load embedded library from /tmp/orly-libsecp256k1/libsecp256k1.so: Error relocating /tmp/orly-libsecp256k1/libsecp256k1.so: __fprintf_chk: symbol not found, falling back to system paths
2025/11/20 16:26:20 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 3.140113498s
Events/sec: 15922.99
Avg latency: 1.417584ms
P90 latency: 1.918927ms
P95 latency: 2.251932ms
P99 latency: 3.24845ms
Bottom 10% Avg latency: 781.19µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 295.016917ms
Burst completed: 5000 events in 302.477205ms
Burst completed: 5000 events in 296.524079ms
Burst completed: 5000 events in 316.859334ms
Burst completed: 5000 events in 283.043959ms
Burst completed: 5000 events in 599.696348ms
Burst completed: 5000 events in 348.408531ms
Burst completed: 5000 events in 328.489308ms
Burst completed: 5000 events in 346.767823ms
Burst completed: 5000 events in 266.423432ms
Burst test completed: 50000 events in 8.390681222s, errors: 0
Events/sec: 5958.99
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.729378008s
Combined ops/sec: 2021.89
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: 377608 queries in 1m0.004159666s
Queries/sec: 6293.03
Avg query latency: 1.78194ms
P95 query latency: 7.313999ms
P99 query latency: 11.571994ms
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: 300761 operations (250761 queries, 50000 writes) in 1m0.003300562s
Operations/sec: 5012.41
Avg latency: 1.581357ms
Avg query latency: 1.557006ms
Avg write latency: 1.703485ms
P95 latency: 4.198041ms
P99 latency: 7.134837ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 3.140113498s
Total Events: 50000
Events/sec: 15922.99
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 159 MB
Avg Latency: 1.417584ms
P90 Latency: 1.918927ms
P95 Latency: 2.251932ms
P99 Latency: 3.24845ms
Bottom 10% Avg Latency: 781.19µs
----------------------------------------

Test: Burst Pattern
Duration: 8.390681222s
Total Events: 50000
Events/sec: 5958.99
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 210 MB
Avg Latency: 1.446634ms
P90 Latency: 2.254246ms
P95 Latency: 2.884237ms
P99 Latency: 5.436852ms
Bottom 10% Avg Latency: 520.884µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.729378008s
Total Events: 50000
Events/sec: 2021.89
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 204 MB
Avg Latency: 382.367µs
P90 Latency: 799.193µs
P95 Latency: 904.063µs
P99 Latency: 1.193034ms
Bottom 10% Avg Latency: 1.047507ms
----------------------------------------

Test: Query Performance
Duration: 1m0.004159666s
Total Events: 377608
Events/sec: 6293.03
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 117 MB
Avg Latency: 1.78194ms
P90 Latency: 5.391074ms
P95 Latency: 7.313999ms
P99 Latency: 11.571994ms
Bottom 10% Avg Latency: 8.16248ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.003300562s
Total Events: 300761
Events/sec: 5012.41
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 133 MB
Avg Latency: 1.581357ms
P90 Latency: 3.256466ms
P95 Latency: 4.198041ms
P99 Latency: 7.134837ms
Bottom 10% Avg Latency: 4.912876ms
----------------------------------------

Report saved to: /tmp/benchmark_relayer-basic_8/benchmark_report.txt
AsciiDoc report saved to: /tmp/benchmark_relayer-basic_8/benchmark_report.adoc

RELAY_NAME: relayer-basic
RELAY_URL: ws://relayer-basic:7447
TEST_TIMESTAMP: 2025-11-20T16:29:38+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
