Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_relayer-basic_8
Events: 50000, Workers: 24, Duration: 1m0s
1763653413403632ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763653413403714ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763653413403774ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763653413403787ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287
1763653413403798ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332
1763653413403814ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763653413403819ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340
1763653413403829ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429
1763653413403835ℹ️ 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 15:43:33 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 15:43:33 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 3.291311068s
Events/sec: 15191.51
Avg latency: 1.494499ms
P90 latency: 2.107626ms
P95 latency: 2.461731ms
P99 latency: 3.662388ms
Bottom 10% Avg latency: 790.923µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 344.087556ms
Burst completed: 5000 events in 311.578355ms
Burst completed: 5000 events in 276.67865ms
Burst completed: 5000 events in 295.952793ms
Burst completed: 5000 events in 314.347861ms
Burst completed: 5000 events in 365.599791ms
Burst completed: 5000 events in 312.086332ms
Burst completed: 5000 events in 299.872209ms
Burst completed: 5000 events in 328.254546ms
Burst completed: 5000 events in 283.179754ms
Burst test completed: 50000 events in 8.137375007s, errors: 0
Events/sec: 6144.49
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.527874554s
Combined ops/sec: 2038.50
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: 404814 queries in 1m0.005258143s
Queries/sec: 6746.31
Avg query latency: 1.649233ms
P95 query latency: 6.427316ms
P99 query latency: 10.348647ms
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: 321308 operations (271308 queries, 50000 writes) in 1m0.002966019s
Operations/sec: 5354.87
Avg latency: 1.426015ms
Avg query latency: 1.403835ms
Avg write latency: 1.546366ms
P95 latency: 3.544854ms
P99 latency: 5.812454ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 3.291311068s
Total Events: 50000
Events/sec: 15191.51
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 96 MB
Avg Latency: 1.494499ms
P90 Latency: 2.107626ms
P95 Latency: 2.461731ms
P99 Latency: 3.662388ms
Bottom 10% Avg Latency: 790.923µs
----------------------------------------

Test: Burst Pattern
Duration: 8.137375007s
Total Events: 50000
Events/sec: 6144.49
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 204 MB
Avg Latency: 1.322915ms
P90 Latency: 1.930428ms
P95 Latency: 2.255818ms
P99 Latency: 3.262786ms
Bottom 10% Avg Latency: 503.483µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.527874554s
Total Events: 50000
Events/sec: 2038.50
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 132 MB
Avg Latency: 383.613µs
P90 Latency: 799.103µs
P95 Latency: 888.112µs
P99 Latency: 1.115605ms
Bottom 10% Avg Latency: 1.022007ms
----------------------------------------

Test: Query Performance
Duration: 1m0.005258143s
Total Events: 404814
Events/sec: 6746.31
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 125 MB
Avg Latency: 1.649233ms
P90 Latency: 4.874718ms
P95 Latency: 6.427316ms
P99 Latency: 10.348647ms
Bottom 10% Avg Latency: 7.248468ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.002966019s
Total Events: 321308
Events/sec: 5354.87
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 89 MB
Avg Latency: 1.426015ms
P90 Latency: 2.835111ms
P95 Latency: 3.544854ms
P99 Latency: 5.812454ms
Bottom 10% Avg Latency: 4.119764ms
----------------------------------------

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-20T15:46:51+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
