Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_rely-sqlite_8
Events: 50000, Workers: 24, Duration: 1m0s
1764840025108837ℹ️ migrating to version 1... /build/pkg/database/migrations.go:68
1764840025108932ℹ️ migrating to version 2... /build/pkg/database/migrations.go:75
1764840025108958ℹ️ migrating to version 3... /build/pkg/database/migrations.go:82
1764840025108965ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:304
1764840025108976ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:349
1764840025108998ℹ️ migrating to version 4... /build/pkg/database/migrations.go:89
1764840025109005ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:357
1764840025109017ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:446
1764840025109023ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:555
1764840025109041ℹ️ migrating to version 5... /build/pkg/database/migrations.go:96
1764840025109047ℹ️ re-encoding events with optimized tag binary format... /build/pkg/database/migrations.go:562
1764840025109059ℹ️ found 0 events with e/p tags to re-encode /build/pkg/database/migrations.go:649
1764840025109087ℹ️ no events need re-encoding /build/pkg/database/migrations.go:652
1764840025109131ℹ️ migrating to version 6... /build/pkg/database/migrations.go:103
1764840025109138ℹ️ converting events to compact serial-reference format... /build/pkg/database/migrations.go:706
1764840025109161ℹ️ found 0 events to convert to compact format /build/pkg/database/migrations.go:846
1764840025109166ℹ️ 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:20:25 INFO: Extracted embedded libsecp256k1 to /tmp/orly-libsecp256k1/libsecp256k1.so
2025/12/04 09:20:25 INFO: Successfully loaded embedded libsecp256k1 v5.0.0 from /tmp/orly-libsecp256k1/libsecp256k1.so
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 2.916633222s
Events/sec: 17143.05
Avg latency: 1.278819ms
P90 latency: 1.645294ms
P95 latency: 1.861406ms
P99 latency: 3.124622ms
Bottom 10% Avg latency: 729.231µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 299.940949ms
Burst completed: 5000 events in 320.651151ms
Burst completed: 5000 events in 285.455745ms
Burst completed: 5000 events in 309.502203ms
Burst completed: 5000 events in 298.703461ms
Burst completed: 5000 events in 298.785067ms
Burst completed: 5000 events in 272.364406ms
Burst completed: 5000 events in 264.606838ms
Burst completed: 5000 events in 315.333631ms
Burst completed: 5000 events in 290.913401ms
Burst test completed: 50000 events in 7.960160876s, errors: 0
Events/sec: 6281.28
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.295679369s
Combined ops/sec: 2057.98
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: 409908 queries in 1m0.005235789s
Queries/sec: 6831.20
Avg query latency: 2.219665ms
P95 query latency: 8.253853ms
P99 query latency: 12.450497ms
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: 312694 operations (262694 queries, 50000 writes) in 1m0.003601943s
Operations/sec: 5211.25
Avg latency: 1.479337ms
Avg query latency: 1.552934ms
Avg write latency: 1.092669ms
P95 latency: 3.715568ms
P99 latency: 9.865884ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 2.916633222s
Total Events: 50000
Events/sec: 17143.05
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 199 MB
Avg Latency: 1.278819ms
P90 Latency: 1.645294ms
P95 Latency: 1.861406ms
P99 Latency: 3.124622ms
Bottom 10% Avg Latency: 729.231µs
----------------------------------------

Test: Burst Pattern
Duration: 7.960160876s
Total Events: 50000
Events/sec: 6281.28
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 172 MB
Avg Latency: 1.284949ms
P90 Latency: 1.745856ms
P95 Latency: 2.012483ms
P99 Latency: 3.414064ms
Bottom 10% Avg Latency: 603.349µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.295679369s
Total Events: 50000
Events/sec: 2057.98
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 188 MB
Avg Latency: 386.608µs
P90 Latency: 813.46µs
P95 Latency: 908.982µs
P99 Latency: 1.125173ms
Bottom 10% Avg Latency: 1.033435ms
----------------------------------------

Test: Query Performance
Duration: 1m0.005235789s
Total Events: 409908
Events/sec: 6831.20
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 203 MB
Avg Latency: 2.219665ms
P90 Latency: 6.727054ms
P95 Latency: 8.253853ms
P99 Latency: 12.450497ms
Bottom 10% Avg Latency: 9.092639ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.003601943s
Total Events: 312694
Events/sec: 5211.25
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 134 MB
Avg Latency: 1.479337ms
P90 Latency: 2.996278ms
P95 Latency: 3.715568ms
P99 Latency: 9.865884ms
Bottom 10% Avg Latency: 5.322579ms
----------------------------------------

Report saved to: /tmp/benchmark_rely-sqlite_8/benchmark_report.txt
AsciiDoc report saved to: /tmp/benchmark_rely-sqlite_8/benchmark_report.adoc

RELAY_NAME: rely-sqlite
RELAY_URL: ws://rely-sqlite:3334
TEST_TIMESTAMP: 2025-12-04T09:23:41+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
