Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_khatru-sqlite_8
Events: 50000, Workers: 24, Duration: 1m0s
1763655574035860ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763655574035914ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763655574035943ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763655574035949ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287
1763655574035958ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332
1763655574035975ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763655574035982ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340
1763655574035992ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429
1763655574035997ℹ️ 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:19:34 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:19:34 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 3.232222717s
Events/sec: 15469.23
Avg latency: 1.469007ms
P90 latency: 2.035701ms
P95 latency: 2.349899ms
P99 latency: 3.271326ms
Bottom 10% Avg latency: 801.936µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 299.732401ms
Burst completed: 5000 events in 329.942997ms
Burst completed: 5000 events in 277.351209ms
Burst completed: 5000 events in 317.930408ms
Burst completed: 5000 events in 273.472906ms
Burst completed: 5000 events in 337.06975ms
Burst completed: 5000 events in 340.407772ms
Burst completed: 5000 events in 358.760144ms
Burst completed: 5000 events in 309.592493ms
Burst completed: 5000 events in 273.260581ms
Burst test completed: 50000 events in 8.125781511s, errors: 0
Events/sec: 6153.25
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.566923076s
Combined ops/sec: 2035.26
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: 402485 queries in 1m0.004783968s
Queries/sec: 6707.55
Avg query latency: 1.665358ms
P95 query latency: 6.573038ms
P99 query latency: 10.409271ms
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: 311988 operations (261988 queries, 50000 writes) in 1m0.003852034s
Operations/sec: 5199.47
Avg latency: 1.508403ms
Avg query latency: 1.478354ms
Avg write latency: 1.665855ms
P95 latency: 3.826874ms
P99 latency: 6.740607ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 3.232222717s
Total Events: 50000
Events/sec: 15469.23
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 101 MB
Avg Latency: 1.469007ms
P90 Latency: 2.035701ms
P95 Latency: 2.349899ms
P99 Latency: 3.271326ms
Bottom 10% Avg Latency: 801.936µs
----------------------------------------

Test: Burst Pattern
Duration: 8.125781511s
Total Events: 50000
Events/sec: 6153.25
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 253 MB
Avg Latency: 1.339912ms
P90 Latency: 1.931472ms
P95 Latency: 2.248376ms
P99 Latency: 3.415521ms
Bottom 10% Avg Latency: 558.036µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.566923076s
Total Events: 50000
Events/sec: 2035.26
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 183 MB
Avg Latency: 387.89µs
P90 Latency: 800.235µs
P95 Latency: 893.473µs
P99 Latency: 1.116417ms
Bottom 10% Avg Latency: 1.061513ms
----------------------------------------

Test: Query Performance
Duration: 1m0.004783968s
Total Events: 402485
Events/sec: 6707.55
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 122 MB
Avg Latency: 1.665358ms
P90 Latency: 4.967519ms
P95 Latency: 6.573038ms
P99 Latency: 10.409271ms
Bottom 10% Avg Latency: 7.318028ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.003852034s
Total Events: 311988
Events/sec: 5199.47
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 123 MB
Avg Latency: 1.508403ms
P90 Latency: 3.026719ms
P95 Latency: 3.826874ms
P99 Latency: 6.740607ms
Bottom 10% Avg Latency: 4.581461ms
----------------------------------------

Report saved to: /tmp/benchmark_khatru-sqlite_8/benchmark_report.txt
AsciiDoc report saved to: /tmp/benchmark_khatru-sqlite_8/benchmark_report.adoc

RELAY_NAME: khatru-sqlite
RELAY_URL: ws://khatru-sqlite:3334
TEST_TIMESTAMP: 2025-11-20T16:22:51+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
