Starting Nostr Relay Benchmark (Badger Backend)
Data Directory: /tmp/benchmark_next-orly-badger_8
Events: 50000, Workers: 24, Duration: 1m0s
1763552503625884ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763552503625955ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763552503625976ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763552503625981ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287
1763552503625991ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332
1763552503626007ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763552503626012ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340
1763552503626026ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429
1763552503626033ℹ️ 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:41:43 INFO: Extracted embedded libsecp256k1 to /tmp/orly-libsecp256k1/libsecp256k1.so
2025/11/19 11:41:43 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:41:43 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2
Events saved: 50000/50000 (100.0%), errors: 0
Duration: 2.785536478s
Events/sec: 17949.86
Avg latency: 1.089014ms
P90 latency: 1.55218ms
P95 latency: 1.801326ms
P99 latency: 2.589579ms
Bottom 10% Avg latency: 552.633µs
Wiping database between tests...
RunBurstPatternTest (Badger)..

=== Burst Pattern Test ===
Burst completed: 5000 events in 317.450827ms
Burst completed: 5000 events in 281.729068ms
Burst completed: 5000 events in 296.735543ms
Burst completed: 5000 events in 299.018917ms
Burst completed: 5000 events in 266.294256ms
Burst completed: 5000 events in 298.28913ms
Burst completed: 5000 events in 342.863483ms
Burst completed: 5000 events in 278.70182ms
Burst completed: 5000 events in 290.619707ms
Burst completed: 5000 events in 266.326046ms
Burst test completed: 50000 events in 7.944358646s, errors: 0
Events/sec: 6293.77
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.356991604s
Combined ops/sec: 2052.80
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: 437548 queries in 1m0.00346203s
Queries/sec: 7292.05
Avg query latency: 1.484983ms
P95 query latency: 5.829694ms
P99 query latency: 9.624546ms
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: 328438 operations (278438 queries, 50000 writes) in 1m0.00427172s
Operations/sec: 5473.58
Avg latency: 1.350439ms
Avg query latency: 1.327273ms
Avg write latency: 1.479447ms
P95 latency: 3.495151ms
P99 latency: 5.959117ms

=== Badger benchmark completed ===


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

Test: Peak Throughput
Duration: 2.785536478s
Total Events: 50000
Events/sec: 17949.86
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 155 MB
Avg Latency: 1.089014ms
P90 Latency: 1.55218ms
P95 Latency: 1.801326ms
P99 Latency: 2.589579ms
Bottom 10% Avg Latency: 552.633µs
----------------------------------------

Test: Burst Pattern
Duration: 7.944358646s
Total Events: 50000
Events/sec: 6293.77
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 364 MB
Avg Latency: 749.292µs
P90 Latency: 1.280402ms
P95 Latency: 1.544064ms
P99 Latency: 2.361203ms
Bottom 10% Avg Latency: 266.475µs
----------------------------------------

Test: Mixed Read/Write
Duration: 24.356991604s
Total Events: 50000
Events/sec: 2052.80
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 181 MB
Avg Latency: 348.627µs
P90 Latency: 716.516µs
P95 Latency: 797.32µs
P99 Latency: 974.468µs
Bottom 10% Avg Latency: 896.226µs
----------------------------------------

Test: Query Performance
Duration: 1m0.00346203s
Total Events: 437548
Events/sec: 7292.05
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 130 MB
Avg Latency: 1.484983ms
P90 Latency: 4.34872ms
P95 Latency: 5.829694ms
P99 Latency: 9.624546ms
Bottom 10% Avg Latency: 6.619683ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.00427172s
Total Events: 328438
Events/sec: 5473.58
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 119 MB
Avg Latency: 1.350439ms
P90 Latency: 2.752967ms
P95 Latency: 3.495151ms
P99 Latency: 5.959117ms
Bottom 10% Avg Latency: 4.092929ms
----------------------------------------

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