Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_next-orly-neo4j_8
Events: 50000, Workers: 24, Duration: 1m0s
1763652805203358ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763652805203420ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763652805203442ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763652805203447ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287
1763652805203457ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332
1763652805203478ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763652805203483ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340
1763652805203495ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429
1763652805203501ℹ️ 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 15:33:25 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 15:33:25 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 2.857480805s
Events/sec: 17497.93
Avg latency: 1.220061ms
P90 latency: 1.596304ms
P95 latency: 1.873592ms
P99 latency: 2.782174ms
Bottom 10% Avg latency: 689.107µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 281.99337ms
Burst completed: 5000 events in 295.005478ms
Burst completed: 5000 events in 269.052958ms
Burst completed: 5000 events in 354.874939ms
Burst completed: 5000 events in 272.895272ms
Burst completed: 5000 events in 323.411741ms
Burst completed: 5000 events in 292.611169ms
Burst completed: 5000 events in 302.127762ms
Burst completed: 5000 events in 319.054762ms
Burst completed: 5000 events in 278.810535ms
Burst test completed: 50000 events in 7.994629013s, errors: 0
Events/sec: 6254.20
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.55551402s
Combined ops/sec: 2036.20
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: 409386 queries in 1m0.004731834s
Queries/sec: 6822.56
Avg query latency: 1.626092ms
P95 query latency: 6.350996ms
P99 query latency: 10.054136ms
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: 323034 operations (273034 queries, 50000 writes) in 1m0.00211611s
Operations/sec: 5383.71
Avg latency: 1.425098ms
Avg query latency: 1.396374ms
Avg write latency: 1.58195ms
P95 latency: 3.545999ms
P99 latency: 6.036557ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 2.857480805s
Total Events: 50000
Events/sec: 17497.93
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 146 MB
Avg Latency: 1.220061ms
P90 Latency: 1.596304ms
P95 Latency: 1.873592ms
P99 Latency: 2.782174ms
Bottom 10% Avg Latency: 689.107µs
----------------------------------------

Test: Burst Pattern
Duration: 7.994629013s
Total Events: 50000
Events/sec: 6254.20
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 252 MB
Avg Latency: 1.207729ms
P90 Latency: 1.708517ms
P95 Latency: 2.026464ms
P99 Latency: 3.279542ms
Bottom 10% Avg Latency: 485.191µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.55551402s
Total Events: 50000
Events/sec: 2036.20
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 136 MB
Avg Latency: 373.684µs
P90 Latency: 776.891µs
P95 Latency: 860.711µs
P99 Latency: 1.061864ms
Bottom 10% Avg Latency: 1.011492ms
----------------------------------------

Test: Query Performance
Duration: 1m0.004731834s
Total Events: 409386
Events/sec: 6822.56
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 116 MB
Avg Latency: 1.626092ms
P90 Latency: 4.833133ms
P95 Latency: 6.350996ms
P99 Latency: 10.054136ms
Bottom 10% Avg Latency: 7.107595ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.00211611s
Total Events: 323034
Events/sec: 5383.71
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 90 MB
Avg Latency: 1.425098ms
P90 Latency: 2.805728ms
P95 Latency: 3.545999ms
P99 Latency: 6.036557ms
Bottom 10% Avg Latency: 4.162695ms
----------------------------------------

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

RELAY_NAME: next-orly-neo4j
RELAY_URL: ws://next-orly-neo4j:8080
TEST_TIMESTAMP: 2025-11-20T15:36:42+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
