Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_relayer-basic_8
Events: 50000, Workers: 24, Duration: 1m0s
1763553515697722ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763553515697789ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763553515697814ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763553515697821ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287
1763553515697832ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332
1763553515697850ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763553515697856ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340
1763553515697872ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429
1763553515697879ℹ️ 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/19 11:58:35 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/19 11:58:35 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 2.803257666s
Events/sec: 17836.39
Avg latency: 1.081434ms
P90 latency: 1.542545ms
P95 latency: 1.853627ms
P99 latency: 3.03258ms
Bottom 10% Avg latency: 525.619µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 285.768096ms
Burst completed: 5000 events in 295.661708ms
Burst completed: 5000 events in 313.067191ms
Burst completed: 5000 events in 295.800371ms
Burst completed: 5000 events in 282.901081ms
Burst completed: 5000 events in 322.19214ms
Burst completed: 5000 events in 332.397114ms
Burst completed: 5000 events in 272.623827ms
Burst completed: 5000 events in 255.567207ms
Burst completed: 5000 events in 311.027979ms
Burst test completed: 50000 events in 7.973444489s, errors: 0
Events/sec: 6270.82
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.504151701s
Combined ops/sec: 2040.47
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: 410656 queries in 1m0.007248632s
Queries/sec: 6843.44
Avg query latency: 1.610981ms
P95 query latency: 6.475108ms
P99 query latency: 10.557655ms
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: 329875 operations (279875 queries, 50000 writes) in 1m0.002939993s
Operations/sec: 5497.65
Avg latency: 1.347653ms
Avg query latency: 1.319379ms
Avg write latency: 1.505918ms
P95 latency: 3.479869ms
P99 latency: 5.990926ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 2.803257666s
Total Events: 50000
Events/sec: 17836.39
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 132 MB
Avg Latency: 1.081434ms
P90 Latency: 1.542545ms
P95 Latency: 1.853627ms
P99 Latency: 3.03258ms
Bottom 10% Avg Latency: 525.619µs
----------------------------------------

Test: Burst Pattern
Duration: 7.973444489s
Total Events: 50000
Events/sec: 6270.82
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 239 MB
Avg Latency: 951.65µs
P90 Latency: 1.501036ms
P95 Latency: 1.779976ms
P99 Latency: 2.806119ms
Bottom 10% Avg Latency: 307.676µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.504151701s
Total Events: 50000
Events/sec: 2040.47
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 159 MB
Avg Latency: 358.608µs
P90 Latency: 741.841µs
P95 Latency: 831.883µs
P99 Latency: 1.05125ms
Bottom 10% Avg Latency: 913.888µs
----------------------------------------

Test: Query Performance
Duration: 1m0.007248632s
Total Events: 410656
Events/sec: 6843.44
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 132 MB
Avg Latency: 1.610981ms
P90 Latency: 4.794751ms
P95 Latency: 6.475108ms
P99 Latency: 10.557655ms
Bottom 10% Avg Latency: 7.3137ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.002939993s
Total Events: 329875
Events/sec: 5497.65
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 102 MB
Avg Latency: 1.347653ms
P90 Latency: 2.710576ms
P95 Latency: 3.479869ms
P99 Latency: 5.990926ms
Bottom 10% Avg Latency: 4.105794ms
----------------------------------------

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-19T12:01:52+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
