Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_relayer-basic_8
Events: 50000, Workers: 24, Duration: 1m0s
1764846109277147ℹ️ migrating to version 1... /build/pkg/database/migrations.go:68
1764846109277265ℹ️ migrating to version 2... /build/pkg/database/migrations.go:75
1764846109277319ℹ️ migrating to version 3... /build/pkg/database/migrations.go:82
1764846109277325ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:304
1764846109277335ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:349
1764846109277350ℹ️ migrating to version 4... /build/pkg/database/migrations.go:89
1764846109277355ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:357
1764846109277363ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:446
1764846109277369ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:555
1764846109277389ℹ️ migrating to version 5... /build/pkg/database/migrations.go:96
1764846109277396ℹ️ re-encoding events with optimized tag binary format... /build/pkg/database/migrations.go:562
1764846109277405ℹ️ found 0 events with e/p tags to re-encode /build/pkg/database/migrations.go:649
1764846109277410ℹ️ no events need re-encoding /build/pkg/database/migrations.go:652
1764846109277424ℹ️ migrating to version 6... /build/pkg/database/migrations.go:103
1764846109277429ℹ️ converting events to compact serial-reference format... /build/pkg/database/migrations.go:706
1764846109277439ℹ️ found 0 events to convert to compact format /build/pkg/database/migrations.go:846
1764846109277443ℹ️ 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 11:01:49 INFO: Successfully loaded embedded libsecp256k1 v5.0.0 from /tmp/orly-libsecp256k1/libsecp256k1.so
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 3.829064715s
Events/sec: 13058.02
Avg latency: 1.792879ms
P90 latency: 2.621872ms
P95 latency: 3.153103ms
P99 latency: 4.914106ms
Bottom 10% Avg latency: 919.64µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 406.089196ms
Burst completed: 5000 events in 571.162214ms
Burst completed: 5000 events in 417.21044ms
Burst completed: 5000 events in 388.695149ms
Burst completed: 5000 events in 448.68702ms
Burst completed: 5000 events in 349.680067ms
Burst completed: 5000 events in 352.379547ms
Burst completed: 5000 events in 348.007743ms
Burst completed: 5000 events in 396.819076ms
Burst completed: 5000 events in 388.190088ms
Burst test completed: 50000 events in 9.077665116s, errors: 0
Events/sec: 5508.02
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.750507885s
Combined ops/sec: 2020.16
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: 272535 queries in 1m0.006407297s
Queries/sec: 4541.76
Avg query latency: 3.702484ms
P95 query latency: 14.064278ms
P99 query latency: 21.546984ms
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: 236255 operations (186255 queries, 50000 writes) in 1m0.005350378s
Operations/sec: 3937.23
Avg latency: 2.284443ms
Avg query latency: 2.471631ms
Avg write latency: 1.58715ms
P95 latency: 6.469447ms
P99 latency: 17.551758ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 3.829064715s
Total Events: 50000
Events/sec: 13058.02
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 226 MB
Avg Latency: 1.792879ms
P90 Latency: 2.621872ms
P95 Latency: 3.153103ms
P99 Latency: 4.914106ms
Bottom 10% Avg Latency: 919.64µs
----------------------------------------

Test: Burst Pattern
Duration: 9.077665116s
Total Events: 50000
Events/sec: 5508.02
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 263 MB
Avg Latency: 1.938961ms
P90 Latency: 2.872088ms
P95 Latency: 3.585166ms
P99 Latency: 6.443979ms
Bottom 10% Avg Latency: 919.151µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.750507885s
Total Events: 50000
Events/sec: 2020.16
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 173 MB
Avg Latency: 448.262µs
P90 Latency: 942.865µs
P95 Latency: 1.09768ms
P99 Latency: 1.554199ms
Bottom 10% Avg Latency: 1.241163ms
----------------------------------------

Test: Query Performance
Duration: 1m0.006407297s
Total Events: 272535
Events/sec: 4541.76
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 134 MB
Avg Latency: 3.702484ms
P90 Latency: 10.940029ms
P95 Latency: 14.064278ms
P99 Latency: 21.546984ms
Bottom 10% Avg Latency: 15.564533ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.005350378s
Total Events: 236255
Events/sec: 3937.23
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 200 MB
Avg Latency: 2.284443ms
P90 Latency: 4.876796ms
P95 Latency: 6.469447ms
P99 Latency: 17.551758ms
Bottom 10% Avg Latency: 8.957464ms
----------------------------------------

Report saved to: /tmp/benchmark_relayer-basic_8/benchmark_report.txt
AsciiDoc report saved to: /tmp/benchmark_relayer-basic_8/benchmark_report.adoc

RELAY_NAME: relayer-basic
RELAY_URL: ws://relayer-basic:7447
TEST_TIMESTAMP: 2025-12-04T11:05:08+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
