Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_next-orly-dgraph_8
Events: 50000, Workers: 24, Duration: 1m0s
1763838826199118ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763838826199210ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763838826199247ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763838826199256ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:294
1763838826199269ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:339
1763838826199289ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763838826199295ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:347
1763838826199309ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:436
1763838826199316ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:545
1763838826199335ℹ️ migrating to version 5... /build/pkg/database/migrations.go:94
1763838826199341ℹ️ re-encoding events with optimized tag binary format... /build/pkg/database/migrations.go:552
1763838826199351ℹ️ found 0 events with e/p tags to re-encode /build/pkg/database/migrations.go:639
1763838826199356ℹ️ 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:13:46 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:13:46 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 3.119005212s
Events/sec: 16030.75
Avg latency: 1.395117ms
P90 latency: 1.905706ms
P95 latency: 2.2327ms
P99 latency: 3.309945ms
Bottom 10% Avg latency: 759.404µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 303.869245ms
Burst completed: 5000 events in 306.183047ms
Burst completed: 5000 events in 276.458606ms
Burst completed: 5000 events in 304.076404ms
Burst completed: 5000 events in 307.511965ms
Burst completed: 5000 events in 369.956481ms
Burst completed: 5000 events in 307.122565ms
Burst completed: 5000 events in 282.994622ms
Burst completed: 5000 events in 288.818591ms
Burst completed: 5000 events in 285.099724ms
Burst test completed: 50000 events in 8.036803222s, errors: 0
Events/sec: 6221.38
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.499088429s
Combined ops/sec: 2040.89
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: 382175 queries in 1m0.005131728s
Queries/sec: 6369.04
Avg query latency: 1.76377ms
P95 query latency: 7.181013ms
P99 query latency: 11.361846ms
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: 304137 operations (254137 queries, 50000 writes) in 1m0.003447398s
Operations/sec: 5068.66
Avg latency: 1.531621ms
Avg query latency: 1.527187ms
Avg write latency: 1.554157ms
P95 latency: 4.058867ms
P99 latency: 6.578532ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 3.119005212s
Total Events: 50000
Events/sec: 16030.75
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 90 MB
Avg Latency: 1.395117ms
P90 Latency: 1.905706ms
P95 Latency: 2.2327ms
P99 Latency: 3.309945ms
Bottom 10% Avg Latency: 759.404µs
----------------------------------------

Test: Burst Pattern
Duration: 8.036803222s
Total Events: 50000
Events/sec: 6221.38
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 201 MB
Avg Latency: 1.256755ms
P90 Latency: 1.81348ms
P95 Latency: 2.095959ms
P99 Latency: 3.000094ms
Bottom 10% Avg Latency: 457.006µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.499088429s
Total Events: 50000
Events/sec: 2040.89
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 174 MB
Avg Latency: 381.925µs
P90 Latency: 793.654µs
P95 Latency: 890.448µs
P99 Latency: 1.114536ms
Bottom 10% Avg Latency: 1.055638ms
----------------------------------------

Test: Query Performance
Duration: 1m0.005131728s
Total Events: 382175
Events/sec: 6369.04
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 145 MB
Avg Latency: 1.76377ms
P90 Latency: 5.387866ms
P95 Latency: 7.181013ms
P99 Latency: 11.361846ms
Bottom 10% Avg Latency: 8.012278ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.003447398s
Total Events: 304137
Events/sec: 5068.66
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 88 MB
Avg Latency: 1.531621ms
P90 Latency: 3.143653ms
P95 Latency: 4.058867ms
P99 Latency: 6.578532ms
Bottom 10% Avg Latency: 4.628862ms
----------------------------------------

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

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