Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_next-orly-dgraph_8
Events: 50000, Workers: 24, Duration: 1m0s
1764142855890301ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1764142855890401ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1764142855890440ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1764142855890449ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:294
1764142855890460ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:339
1764142855890476ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1764142855890481ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:347
1764142855890495ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:436
1764142855890504ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:545
1764142855890528ℹ️ migrating to version 5... /build/pkg/database/migrations.go:94
1764142855890536ℹ️ re-encoding events with optimized tag binary format... /build/pkg/database/migrations.go:552
1764142855890559ℹ️ found 0 events with e/p tags to re-encode /build/pkg/database/migrations.go:639
1764142855890568ℹ️ no events need re-encoding /build/pkg/database/migrations.go:642

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

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

=== Peak Throughput Test ===
2025/11/26 07:40:55 INFO: Successfully loaded embedded libsecp256k1 v5.0.0 from /tmp/orly-libsecp256k1/libsecp256k1.so
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 3.430865656s
Events/sec: 14573.58
Avg latency: 1.571025ms
P90 latency: 2.249507ms
P95 latency: 2.610305ms
P99 latency: 3.786808ms
Bottom 10% Avg latency: 802.953µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 413.260391ms
Burst completed: 5000 events in 416.696811ms
Burst completed: 5000 events in 281.278288ms
Burst completed: 5000 events in 305.471838ms
Burst completed: 5000 events in 284.063576ms
Burst completed: 5000 events in 366.197285ms
Burst completed: 5000 events in 310.188337ms
Burst completed: 5000 events in 270.424131ms
Burst completed: 5000 events in 313.061864ms
Burst completed: 5000 events in 268.841724ms
Burst test completed: 50000 events in 8.234222191s, errors: 0
Events/sec: 6072.22
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.374242444s
Combined ops/sec: 2051.35
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: 363398 queries in 1m0.008386122s
Queries/sec: 6055.79
Avg query latency: 1.896628ms
P95 query latency: 7.915977ms
P99 query latency: 12.369055ms
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: 310491 operations (260491 queries, 50000 writes) in 1m0.002972174s
Operations/sec: 5174.59
Avg latency: 1.519446ms
Avg query latency: 1.48579ms
Avg write latency: 1.694789ms
P95 latency: 3.910804ms
P99 latency: 6.189507ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 3.430865656s
Total Events: 50000
Events/sec: 14573.58
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 128 MB
Avg Latency: 1.571025ms
P90 Latency: 2.249507ms
P95 Latency: 2.610305ms
P99 Latency: 3.786808ms
Bottom 10% Avg Latency: 802.953µs
----------------------------------------

Test: Burst Pattern
Duration: 8.234222191s
Total Events: 50000
Events/sec: 6072.22
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 195 MB
Avg Latency: 1.454825ms
P90 Latency: 2.128246ms
P95 Latency: 2.541414ms
P99 Latency: 3.875045ms
Bottom 10% Avg Latency: 688.084µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.374242444s
Total Events: 50000
Events/sec: 2051.35
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 125 MB
Avg Latency: 390.403µs
P90 Latency: 807.74µs
P95 Latency: 902.751µs
P99 Latency: 1.111889ms
Bottom 10% Avg Latency: 1.037165ms
----------------------------------------

Test: Query Performance
Duration: 1m0.008386122s
Total Events: 363398
Events/sec: 6055.79
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 149 MB
Avg Latency: 1.896628ms
P90 Latency: 5.916526ms
P95 Latency: 7.915977ms
P99 Latency: 12.369055ms
Bottom 10% Avg Latency: 8.802319ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.002972174s
Total Events: 310491
Events/sec: 5174.59
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 156 MB
Avg Latency: 1.519446ms
P90 Latency: 3.03826ms
P95 Latency: 3.910804ms
P99 Latency: 6.189507ms
Bottom 10% Avg Latency: 4.473046ms
----------------------------------------

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

RELAY_NAME: next-orly-dgraph
RELAY_URL: ws://next-orly-dgraph:8080
TEST_TIMESTAMP: 2025-11-26T07:44:13+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
