Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_next-orly-dgraph_8
Events: 50000, Workers: 24, Duration: 1m0s
1763552705731078ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763552705731138ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763552705731158ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763552705731164ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287
1763552705731174ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332
1763552705731188ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763552705731192ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340
1763552705731202ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429
1763552705731208ℹ️ 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/19 11:45:05 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/19 11:45:05 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 2.836527264s
Events/sec: 17627.19
Avg latency: 1.103766ms
P90 latency: 1.593556ms
P95 latency: 1.895983ms
P99 latency: 3.010115ms
Bottom 10% Avg latency: 537.227µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 280.061027ms
Burst completed: 5000 events in 300.335244ms
Burst completed: 5000 events in 275.258322ms
Burst completed: 5000 events in 313.843188ms
Burst completed: 5000 events in 312.900441ms
Burst completed: 5000 events in 328.998411ms
Burst completed: 5000 events in 351.267097ms
Burst completed: 5000 events in 301.59792ms
Burst completed: 5000 events in 258.613699ms
Burst completed: 5000 events in 283.438618ms
Burst test completed: 50000 events in 8.011527851s, errors: 0
Events/sec: 6241.01
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.458311788s
Combined ops/sec: 2044.29
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: 419645 queries in 1m0.004626673s
Queries/sec: 6993.54
Avg query latency: 1.565119ms
P95 query latency: 6.288941ms
P99 query latency: 10.508808ms
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: 332245 operations (282245 queries, 50000 writes) in 1m0.003126907s
Operations/sec: 5537.13
Avg latency: 1.357488ms
Avg query latency: 1.299954ms
Avg write latency: 1.682258ms
P95 latency: 3.431084ms
P99 latency: 6.844626ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 2.836527264s
Total Events: 50000
Events/sec: 17627.19
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 155 MB
Avg Latency: 1.103766ms
P90 Latency: 1.593556ms
P95 Latency: 1.895983ms
P99 Latency: 3.010115ms
Bottom 10% Avg Latency: 537.227µs
----------------------------------------

Test: Burst Pattern
Duration: 8.011527851s
Total Events: 50000
Events/sec: 6241.01
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 331 MB
Avg Latency: 973.956µs
P90 Latency: 1.60055ms
P95 Latency: 1.938364ms
P99 Latency: 3.035794ms
Bottom 10% Avg Latency: 318.193µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.458311788s
Total Events: 50000
Events/sec: 2044.29
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 175 MB
Avg Latency: 362.034µs
P90 Latency: 747.544µs
P95 Latency: 839.77µs
P99 Latency: 1.058476ms
Bottom 10% Avg Latency: 953.865µs
----------------------------------------

Test: Query Performance
Duration: 1m0.004626673s
Total Events: 419645
Events/sec: 6993.54
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 120 MB
Avg Latency: 1.565119ms
P90 Latency: 4.643114ms
P95 Latency: 6.288941ms
P99 Latency: 10.508808ms
Bottom 10% Avg Latency: 7.149269ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.003126907s
Total Events: 332245
Events/sec: 5537.13
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 136 MB
Avg Latency: 1.357488ms
P90 Latency: 2.687117ms
P95 Latency: 3.431084ms
P99 Latency: 6.844626ms
Bottom 10% Avg Latency: 4.340237ms
----------------------------------------

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-19T11:48:23+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
