Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_khatru-badger_8
Events: 50000, Workers: 24, Duration: 1m0s
1763655776959677ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763655776959730ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763655776959750ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763655776959756ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287
1763655776959766ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332
1763655776959781ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763655776959786ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340
1763655776959799ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429
1763655776959805ℹ️ 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:22:56 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:22:56 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 3.557122297s
Events/sec: 14056.31
Avg latency: 1.628852ms
P90 latency: 2.412548ms
P95 latency: 2.884718ms
P99 latency: 4.67527ms
Bottom 10% Avg latency: 792.955µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 405.911535ms
Burst completed: 5000 events in 380.53618ms
Burst completed: 5000 events in 280.754351ms
Burst completed: 5000 events in 297.565192ms
Burst completed: 5000 events in 302.520216ms
Burst completed: 5000 events in 350.323686ms
Burst completed: 5000 events in 371.767707ms
Burst completed: 5000 events in 285.38171ms
Burst completed: 5000 events in 274.748193ms
Burst completed: 5000 events in 271.260586ms
Burst test completed: 50000 events in 8.226487654s, errors: 0
Events/sec: 6077.93
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.533132193s
Combined ops/sec: 2038.06
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: 394302 queries in 1m0.00447925s
Queries/sec: 6571.21
Avg query latency: 1.70837ms
P95 query latency: 6.773469ms
P99 query latency: 10.899944ms
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: 317462 operations (267462 queries, 50000 writes) in 1m0.00322203s
Operations/sec: 5290.75
Avg latency: 1.435958ms
Avg query latency: 1.421544ms
Avg write latency: 1.513062ms
P95 latency: 3.617935ms
P99 latency: 5.869627ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 3.557122297s
Total Events: 50000
Events/sec: 14056.31
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 156 MB
Avg Latency: 1.628852ms
P90 Latency: 2.412548ms
P95 Latency: 2.884718ms
P99 Latency: 4.67527ms
Bottom 10% Avg Latency: 792.955µs
----------------------------------------

Test: Burst Pattern
Duration: 8.226487654s
Total Events: 50000
Events/sec: 6077.93
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 205 MB
Avg Latency: 1.310069ms
P90 Latency: 2.055438ms
P95 Latency: 2.49215ms
P99 Latency: 4.005986ms
Bottom 10% Avg Latency: 461.037µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.533132193s
Total Events: 50000
Events/sec: 2038.06
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 199 MB
Avg Latency: 388.704µs
P90 Latency: 808.702µs
P95 Latency: 904.254µs
P99 Latency: 1.136966ms
Bottom 10% Avg Latency: 1.056324ms
----------------------------------------

Test: Query Performance
Duration: 1m0.00447925s
Total Events: 394302
Events/sec: 6571.21
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 115 MB
Avg Latency: 1.70837ms
P90 Latency: 5.078238ms
P95 Latency: 6.773469ms
P99 Latency: 10.899944ms
Bottom 10% Avg Latency: 7.587998ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.00322203s
Total Events: 317462
Events/sec: 5290.75
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 123 MB
Avg Latency: 1.435958ms
P90 Latency: 2.91748ms
P95 Latency: 3.617935ms
P99 Latency: 5.869627ms
Bottom 10% Avg Latency: 4.184418ms
----------------------------------------

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

RELAY_NAME: khatru-badger
RELAY_URL: ws://khatru-badger:3334
TEST_TIMESTAMP: 2025-11-20T16:26:15+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
