Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_next-orly-neo4j_8
Events: 50000, Workers: 24, Duration: 1m0s
1764845495230040ℹ️ migrating to version 1... /build/pkg/database/migrations.go:68
1764845495230118ℹ️ migrating to version 2... /build/pkg/database/migrations.go:75
1764845495230154ℹ️ migrating to version 3... /build/pkg/database/migrations.go:82
1764845495230159ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:304
1764845495230168ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:349
1764845495230182ℹ️ migrating to version 4... /build/pkg/database/migrations.go:89
1764845495230187ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:357
1764845495230198ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:446
1764845495230204ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:555
1764845495230219ℹ️ migrating to version 5... /build/pkg/database/migrations.go:96
1764845495230224ℹ️ re-encoding events with optimized tag binary format... /build/pkg/database/migrations.go:562
1764845495230232ℹ️ found 0 events with e/p tags to re-encode /build/pkg/database/migrations.go:649
1764845495230237ℹ️ no events need re-encoding /build/pkg/database/migrations.go:652
1764845495230250ℹ️ migrating to version 6... /build/pkg/database/migrations.go:103
1764845495230255ℹ️ converting events to compact serial-reference format... /build/pkg/database/migrations.go:706
1764845495230265ℹ️ found 0 events to convert to compact format /build/pkg/database/migrations.go:846
1764845495230269ℹ️ no events need conversion /build/pkg/database/migrations.go:849

╔════════════════════════════════════════════════════════╗
║         BADGER BACKEND BENCHMARK SUITE                 ║
╚════════════════════════════════════════════════════════╝

=== Starting Badger benchmark ===
RunPeakThroughputTest (Badger)..

=== Peak Throughput Test ===
2025/12/04 10:51:35 INFO: Successfully loaded embedded libsecp256k1 v5.0.0 from /tmp/orly-libsecp256k1/libsecp256k1.so
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 3.737037757s
Events/sec: 13379.58
Avg latency: 1.744659ms
P90 latency: 2.47401ms
P95 latency: 2.895953ms
P99 latency: 4.909556ms
Bottom 10% Avg latency: 897.762µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 421.882059ms
Burst completed: 5000 events in 412.531799ms
Burst completed: 5000 events in 429.098267ms
Burst completed: 5000 events in 390.670143ms
Burst completed: 5000 events in 438.603112ms
Burst completed: 5000 events in 366.944086ms
Burst completed: 5000 events in 534.455064ms
Burst completed: 5000 events in 559.621403ms
Burst completed: 5000 events in 393.427363ms
Burst completed: 5000 events in 371.875354ms
Burst test completed: 50000 events in 9.324705477s, errors: 0
Events/sec: 5362.10
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.924958418s
Combined ops/sec: 2006.02
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: 244167 queries in 1m0.008740456s
Queries/sec: 4068.86
Avg query latency: 4.157543ms
P95 query latency: 15.724716ms
P99 query latency: 24.284362ms
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: 227664 operations (177664 queries, 50000 writes) in 1m0.005538199s
Operations/sec: 3794.05
Avg latency: 2.523997ms
Avg query latency: 2.668863ms
Avg write latency: 2.009247ms
P95 latency: 7.235855ms
P99 latency: 20.657306ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 3.737037757s
Total Events: 50000
Events/sec: 13379.58
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 217 MB
Avg Latency: 1.744659ms
P90 Latency: 2.47401ms
P95 Latency: 2.895953ms
P99 Latency: 4.909556ms
Bottom 10% Avg Latency: 897.762µs
----------------------------------------

Test: Burst Pattern
Duration: 9.324705477s
Total Events: 50000
Events/sec: 5362.10
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 304 MB
Avg Latency: 2.063122ms
P90 Latency: 3.130188ms
P95 Latency: 3.8975ms
P99 Latency: 6.378352ms
Bottom 10% Avg Latency: 954.959µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.924958418s
Total Events: 50000
Events/sec: 2006.02
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 272 MB
Avg Latency: 475.177µs
P90 Latency: 996.497µs
P95 Latency: 1.205595ms
P99 Latency: 1.873106ms
Bottom 10% Avg Latency: 1.414397ms
----------------------------------------

Test: Query Performance
Duration: 1m0.008740456s
Total Events: 244167
Events/sec: 4068.86
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 148 MB
Avg Latency: 4.157543ms
P90 Latency: 12.228439ms
P95 Latency: 15.724716ms
P99 Latency: 24.284362ms
Bottom 10% Avg Latency: 17.427943ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.005538199s
Total Events: 227664
Events/sec: 3794.05
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 211 MB
Avg Latency: 2.523997ms
P90 Latency: 5.269722ms
P95 Latency: 7.235855ms
P99 Latency: 20.657306ms
Bottom 10% Avg Latency: 10.288906ms
----------------------------------------

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-12-04T10:54:54+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
