Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_next-orly-neo4j_8
Events: 50000, Workers: 24, Duration: 1m0s
1763552908109792ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763552908109886ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763552908109908ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763552908109914ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287
1763552908109924ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332
1763552908109937ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763552908109942ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340
1763552908109955ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429
1763552908109961ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:538

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

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

=== Peak Throughput Test ===
2025/11/19 11:48:28 WARN: Failed to load embedded library from /tmp/orly-libsecp256k1/libsecp256k1.so: Error relocating /tmp/orly-libsecp256k1/libsecp256k1.so: __fprintf_chk: symbol not found, falling back to system paths
2025/11/19 11:48:28 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 3.218235317s
Events/sec: 15536.46
Avg latency: 1.414281ms
P90 latency: 2.076394ms
P95 latency: 2.486204ms
P99 latency: 3.930355ms
Bottom 10% Avg latency: 704.384µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 301.938212ms
Burst completed: 5000 events in 313.031584ms
Burst completed: 5000 events in 265.709133ms
Burst completed: 5000 events in 307.375893ms
Burst completed: 5000 events in 266.741467ms
Burst completed: 5000 events in 311.20987ms
Burst completed: 5000 events in 317.993736ms
Burst completed: 5000 events in 310.504816ms
Burst completed: 5000 events in 274.515075ms
Burst completed: 5000 events in 300.252051ms
Burst test completed: 50000 events in 7.975519923s, errors: 0
Events/sec: 6269.18
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.405822499s
Combined ops/sec: 2048.69
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: 415410 queries in 1m0.004397847s
Queries/sec: 6922.99
Avg query latency: 1.588134ms
P95 query latency: 6.413781ms
P99 query latency: 10.205668ms
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: 330584 operations (280584 queries, 50000 writes) in 1m0.003241067s
Operations/sec: 5509.44
Avg latency: 1.343539ms
Avg query latency: 1.315494ms
Avg write latency: 1.500921ms
P95 latency: 3.442423ms
P99 latency: 5.829737ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 3.218235317s
Total Events: 50000
Events/sec: 15536.46
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 161 MB
Avg Latency: 1.414281ms
P90 Latency: 2.076394ms
P95 Latency: 2.486204ms
P99 Latency: 3.930355ms
Bottom 10% Avg Latency: 704.384µs
----------------------------------------

Test: Burst Pattern
Duration: 7.975519923s
Total Events: 50000
Events/sec: 6269.18
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 233 MB
Avg Latency: 919.794µs
P90 Latency: 1.535845ms
P95 Latency: 1.842478ms
P99 Latency: 2.842222ms
Bottom 10% Avg Latency: 284.854µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.405822499s
Total Events: 50000
Events/sec: 2048.69
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 158 MB
Avg Latency: 356.992µs
P90 Latency: 736.282µs
P95 Latency: 828.598µs
P99 Latency: 1.054387ms
Bottom 10% Avg Latency: 927.325µs
----------------------------------------

Test: Query Performance
Duration: 1m0.004397847s
Total Events: 415410
Events/sec: 6922.99
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 128 MB
Avg Latency: 1.588134ms
P90 Latency: 4.790039ms
P95 Latency: 6.413781ms
P99 Latency: 10.205668ms
Bottom 10% Avg Latency: 7.154636ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.003241067s
Total Events: 330584
Events/sec: 5509.44
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 120 MB
Avg Latency: 1.343539ms
P90 Latency: 2.726991ms
P95 Latency: 3.442423ms
P99 Latency: 5.829737ms
Bottom 10% Avg Latency: 4.02073ms
----------------------------------------

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-11-19T11:51:45+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
