Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_nostr-rs-relay_8
Events: 50000, Workers: 24, Duration: 1m0s
1763670543093453ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763670543093533ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763670543093555ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763670543093560ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287
1763670543093572ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332
1763670543093586ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763670543093591ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340
1763670543093614ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429
1763670543093619ℹ️ 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 20:29:03 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 20:29:03 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 2.834683217s
Events/sec: 17638.66
Avg latency: 1.18563ms
P90 latency: 1.576272ms
P95 latency: 1.847889ms
P99 latency: 2.69928ms
Bottom 10% Avg latency: 646.954µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 288.243162ms
Burst completed: 5000 events in 295.639176ms
Burst completed: 5000 events in 266.183046ms
Burst completed: 5000 events in 289.772997ms
Burst completed: 5000 events in 346.857517ms
Burst completed: 5000 events in 392.30016ms
Burst completed: 5000 events in 316.952072ms
Burst completed: 5000 events in 278.495452ms
Burst completed: 5000 events in 269.495766ms
Burst completed: 5000 events in 259.647834ms
Burst test completed: 50000 events in 8.010584112s, errors: 0
Events/sec: 6241.74
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.436170149s
Combined ops/sec: 2046.15
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: 420104 queries in 1m0.004812476s
Queries/sec: 7001.17
Avg query latency: 1.581786ms
P95 query latency: 6.095087ms
P99 query latency: 9.681457ms
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: 308305 operations (258305 queries, 50000 writes) in 1m0.003332271s
Operations/sec: 5138.13
Avg latency: 1.532137ms
Avg query latency: 1.49713ms
Avg write latency: 1.712984ms
P95 latency: 3.933782ms
P99 latency: 6.685993ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 2.834683217s
Total Events: 50000
Events/sec: 17638.66
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 88 MB
Avg Latency: 1.18563ms
P90 Latency: 1.576272ms
P95 Latency: 1.847889ms
P99 Latency: 2.69928ms
Bottom 10% Avg Latency: 646.954µs
----------------------------------------

Test: Burst Pattern
Duration: 8.010584112s
Total Events: 50000
Events/sec: 6241.74
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 150 MB
Avg Latency: 1.182584ms
P90 Latency: 1.77976ms
P95 Latency: 2.120267ms
P99 Latency: 3.024349ms
Bottom 10% Avg Latency: 448.582µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.436170149s
Total Events: 50000
Events/sec: 2046.15
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 135 MB
Avg Latency: 369.8µs
P90 Latency: 773.463µs
P95 Latency: 866.51µs
P99 Latency: 1.074516ms
Bottom 10% Avg Latency: 1.00298ms
----------------------------------------

Test: Query Performance
Duration: 1m0.004812476s
Total Events: 420104
Events/sec: 7001.17
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 151 MB
Avg Latency: 1.581786ms
P90 Latency: 4.688809ms
P95 Latency: 6.095087ms
P99 Latency: 9.681457ms
Bottom 10% Avg Latency: 6.825004ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.003332271s
Total Events: 308305
Events/sec: 5138.13
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 98 MB
Avg Latency: 1.532137ms
P90 Latency: 3.100785ms
P95 Latency: 3.933782ms
P99 Latency: 6.685993ms
Bottom 10% Avg Latency: 4.60825ms
----------------------------------------

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-11-20T20:32:20+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
