Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_next-orly-badger_8
Events: 50000, Workers: 24, Duration: 1m0s
1763838623230113ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763838623230189ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763838623230211ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763838623230216ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:294
1763838623230227ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:339
1763838623230248ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763838623230253ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:347
1763838623230263ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:436
1763838623230268ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:545
1763838623230283ℹ️ migrating to version 5... /build/pkg/database/migrations.go:94
1763838623230287ℹ️ re-encoding events with optimized tag binary format... /build/pkg/database/migrations.go:552
1763838623230296ℹ️ found 0 events with e/p tags to re-encode /build/pkg/database/migrations.go:639
1763838623230301ℹ️ no events need re-encoding /build/pkg/database/migrations.go:642

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

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

=== Peak Throughput Test ===
2025/11/22 19:10:23 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/22 19:10:23 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 3.010658794s
Events/sec: 16607.66
Avg latency: 1.338951ms
P90 latency: 1.788958ms
P95 latency: 2.047963ms
P99 latency: 2.856809ms
Bottom 10% Avg latency: 757.49µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 291.670556ms
Burst completed: 5000 events in 360.87238ms
Burst completed: 5000 events in 301.408062ms
Burst completed: 5000 events in 316.375958ms
Burst completed: 5000 events in 376.937291ms
Burst completed: 5000 events in 566.001876ms
Burst completed: 5000 events in 315.464051ms
Burst completed: 5000 events in 317.465099ms
Burst completed: 5000 events in 278.045601ms
Burst completed: 5000 events in 284.298545ms
Burst test completed: 50000 events in 8.415248481s, errors: 0
Events/sec: 5941.60
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.625034214s
Combined ops/sec: 2030.45
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: 381027 queries in 1m0.006635598s
Queries/sec: 6349.75
Avg query latency: 1.772811ms
P95 query latency: 7.236356ms
P99 query latency: 11.279564ms
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: 305823 operations (255823 queries, 50000 writes) in 1m0.003583098s
Operations/sec: 5096.75
Avg latency: 1.56258ms
Avg query latency: 1.51784ms
Avg write latency: 1.791487ms
P95 latency: 4.018388ms
P99 latency: 7.130801ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 3.010658794s
Total Events: 50000
Events/sec: 16607.66
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 129 MB
Avg Latency: 1.338951ms
P90 Latency: 1.788958ms
P95 Latency: 2.047963ms
P99 Latency: 2.856809ms
Bottom 10% Avg Latency: 757.49µs
----------------------------------------

Test: Burst Pattern
Duration: 8.415248481s
Total Events: 50000
Events/sec: 5941.60
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 211 MB
Avg Latency: 1.490934ms
P90 Latency: 2.351964ms
P95 Latency: 2.961357ms
P99 Latency: 5.082311ms
Bottom 10% Avg Latency: 562.053µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.625034214s
Total Events: 50000
Events/sec: 2030.45
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 131 MB
Avg Latency: 399.173µs
P90 Latency: 823.303µs
P95 Latency: 928.904µs
P99 Latency: 1.225059ms
Bottom 10% Avg Latency: 1.081556ms
----------------------------------------

Test: Query Performance
Duration: 1m0.006635598s
Total Events: 381027
Events/sec: 6349.75
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 100 MB
Avg Latency: 1.772811ms
P90 Latency: 5.462421ms
P95 Latency: 7.236356ms
P99 Latency: 11.279564ms
Bottom 10% Avg Latency: 8.018763ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.003583098s
Total Events: 305823
Events/sec: 5096.75
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 99 MB
Avg Latency: 1.56258ms
P90 Latency: 3.106468ms
P95 Latency: 4.018388ms
P99 Latency: 7.130801ms
Bottom 10% Avg Latency: 4.803925ms
----------------------------------------

Report saved to: /tmp/benchmark_next-orly-badger_8/benchmark_report.txt
AsciiDoc report saved to: /tmp/benchmark_next-orly-badger_8/benchmark_report.adoc

RELAY_NAME: next-orly-badger
RELAY_URL: ws://next-orly-badger:8080
TEST_TIMESTAMP: 2025-11-22T19:13:41+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
