Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_next-orly-badger_8
Events: 50000, Workers: 24, Duration: 1m0s
1764840226432341ℹ️ migrating to version 1... /build/pkg/database/migrations.go:68
1764840226432976ℹ️ migrating to version 2... /build/pkg/database/migrations.go:75
1764840226433077ℹ️ migrating to version 3... /build/pkg/database/migrations.go:82
1764840226433085ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:304
1764840226433100ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:349
1764840226433117ℹ️ migrating to version 4... /build/pkg/database/migrations.go:89
1764840226433122ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:357
1764840226433129ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:446
1764840226433135ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:555
1764840226433150ℹ️ migrating to version 5... /build/pkg/database/migrations.go:96
1764840226433155ℹ️ re-encoding events with optimized tag binary format... /build/pkg/database/migrations.go:562
1764840226433164ℹ️ found 0 events with e/p tags to re-encode /build/pkg/database/migrations.go:649
1764840226433169ℹ️ no events need re-encoding /build/pkg/database/migrations.go:652
1764840226433182ℹ️ migrating to version 6... /build/pkg/database/migrations.go:103
1764840226433186ℹ️ converting events to compact serial-reference format... /build/pkg/database/migrations.go:706
1764840226433202ℹ️ found 0 events to convert to compact format /build/pkg/database/migrations.go:846
1764840226433206ℹ️ 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 09:23:46 INFO: Successfully loaded embedded libsecp256k1 v5.0.0 from /tmp/orly-libsecp256k1/libsecp256k1.so
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 2.949326718s
Events/sec: 16953.02
Avg latency: 1.296368ms
P90 latency: 1.675853ms
P95 latency: 1.934996ms
P99 latency: 3.691782ms
Bottom 10% Avg latency: 738.489µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 292.737912ms
Burst completed: 5000 events in 295.756562ms
Burst completed: 5000 events in 280.376675ms
Burst completed: 5000 events in 283.027074ms
Burst completed: 5000 events in 292.213914ms
Burst completed: 5000 events in 292.804158ms
Burst completed: 5000 events in 265.332637ms
Burst completed: 5000 events in 262.359574ms
Burst completed: 5000 events in 271.801669ms
Burst completed: 5000 events in 270.594731ms
Burst test completed: 50000 events in 7.813073176s, errors: 0
Events/sec: 6399.53
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.337354042s
Combined ops/sec: 2054.46
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: 418759 queries in 1m0.009274332s
Queries/sec: 6978.24
Avg query latency: 2.156012ms
P95 query latency: 8.060424ms
P99 query latency: 12.213045ms
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: 313770 operations (263770 queries, 50000 writes) in 1m0.003742319s
Operations/sec: 5229.17
Avg latency: 1.452263ms
Avg query latency: 1.541956ms
Avg write latency: 979.094µs
P95 latency: 3.734524ms
P99 latency: 9.585308ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 2.949326718s
Total Events: 50000
Events/sec: 16953.02
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 286 MB
Avg Latency: 1.296368ms
P90 Latency: 1.675853ms
P95 Latency: 1.934996ms
P99 Latency: 3.691782ms
Bottom 10% Avg Latency: 738.489µs
----------------------------------------

Test: Burst Pattern
Duration: 7.813073176s
Total Events: 50000
Events/sec: 6399.53
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 275 MB
Avg Latency: 1.179921ms
P90 Latency: 1.527861ms
P95 Latency: 1.722912ms
P99 Latency: 3.6275ms
Bottom 10% Avg Latency: 587.766µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.337354042s
Total Events: 50000
Events/sec: 2054.46
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 185 MB
Avg Latency: 387.847µs
P90 Latency: 809.663µs
P95 Latency: 905.205µs
P99 Latency: 1.133569ms
Bottom 10% Avg Latency: 1.057923ms
----------------------------------------

Test: Query Performance
Duration: 1m0.009274332s
Total Events: 418759
Events/sec: 6978.24
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 199 MB
Avg Latency: 2.156012ms
P90 Latency: 6.536561ms
P95 Latency: 8.060424ms
P99 Latency: 12.213045ms
Bottom 10% Avg Latency: 8.880182ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.003742319s
Total Events: 313770
Events/sec: 5229.17
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 177 MB
Avg Latency: 1.452263ms
P90 Latency: 3.028419ms
P95 Latency: 3.734524ms
P99 Latency: 9.585308ms
Bottom 10% Avg Latency: 5.204062ms
----------------------------------------

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

RELAY_NAME: next-orly-badger
RELAY_URL: ws://next-orly-badger:8080
TEST_TIMESTAMP: 2025-12-04T09:27:02+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
