Starting Nostr Relay Benchmark
Data Directory: /tmp/benchmark_next-orly-dgraph_8
Events: 50000, Workers: 24, Duration: 1m0s
1763396600574205ℹ️ /tmp/benchmark_next-orly-dgraph_8: All 0 tables opened in 0s
/go/pkg/mod/github.com/dgraph-io/badger/v4@v4.8.0/levels.go:161 /build/pkg/database/logger.go:56
1763396600577795ℹ️ /tmp/benchmark_next-orly-dgraph_8: Discard stats nextEmptySlot: 0
/go/pkg/mod/github.com/dgraph-io/badger/v4@v4.8.0/discard.go:55 /build/pkg/database/logger.go:56
1763396600577852ℹ️ /tmp/benchmark_next-orly-dgraph_8: Set nextTxnTs to 0
/go/pkg/mod/github.com/dgraph-io/badger/v4@v4.8.0/db.go:358 /build/pkg/database/logger.go:56
1763396600578216ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763396600578287ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763396600578319ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763396600578325ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287
1763396600578334ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332
1763396600578350ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763396600578355ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340
1763396600578372ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429
1763396600578378ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:538

=== Starting test round 1/2 ===
RunPeakThroughputTest..

=== Peak Throughput Test ===
2025/11/17 16:23:20 INFO: Successfully loaded libsecp256k1 v5.0.0 from libsecp256k1.so.2
1763396602578437ℹ️ /tmp/benchmark_next-orly-dgraph_8: database warmup complete, ready to serve requests
/usr/local/go/src/runtime/asm_amd64.s:1693 /build/pkg/database/logger.go:56
Events saved: 50000/50000 (100.0%)
Duration: 4.932431923s
Events/sec: 10136.99
Avg latency: 1.667317ms
P90 latency: 2.069461ms
P95 latency: 2.249895ms
P99 latency: 2.861303ms
Bottom 10% Avg latency: 2.592597ms
RunBurstPatternTest..

=== Burst Pattern Test ===
Burst completed: 5000 events in 335.655402ms
Burst completed: 5000 events in 330.360552ms
Burst completed: 5000 events in 350.90491ms
Burst completed: 5000 events in 373.041958ms
Burst completed: 5000 events in 347.11564ms
Burst completed: 5000 events in 315.949199ms
Burst completed: 5000 events in 331.42993ms
Burst completed: 5000 events in 352.164361ms
Burst completed: 5000 events in 359.115619ms
Burst completed: 5000 events in 360.397544ms
Burst test completed: 50000 events in 9.808342155s
Events/sec: 5097.70
RunMixedReadWriteTest..

=== Mixed Read/Write Test ===
Pre-populating database for read tests...
Mixed test completed: 25000 writes, 25000 reads in 24.59623701s
Combined ops/sec: 2032.83
1763396660567060⚠️ /tmp/benchmark_next-orly-dgraph_8: Block cache might be too small. Metrics: hit: 153935 miss: 305257 keys-added: 227607 keys-updated: 64636 keys-evicted: 227588 cost-added: 12452581576986 cost-evicted: 12451583862757 sets-dropped: 0 sets-rejected: 12954 gets-dropped: 256 gets-kept: 458496 gets-total: 459192 hit-ratio: 0.34
/go/pkg/mod/github.com/dgraph-io/badger/v4@v4.8.0/db.go:450 /build/pkg/database/logger.go:46
1763396660567121⚠️ /tmp/benchmark_next-orly-dgraph_8: Cache life expectancy (in seconds): 
 -- Histogram: 
Min value: 0 
Max value: 11 
Count: 227588 
50p: 2.00 
75p: 2.00 
90p: 2.00 
[0, 2) 227552 99.98% 99.98%
[8, 16) 36 0.02% 100.00%
 --
/go/pkg/mod/github.com/dgraph-io/badger/v4@v4.8.0/db.go:451 /build/pkg/database/logger.go:46
RunQueryTest..

=== Query Test ===
Pre-populating database with 10000 events for query tests...
Query test completed: 221626 queries in 1m0.014161671s
Queries/sec: 3692.90
Avg query latency: 4.849059ms
P95 query latency: 15.966874ms
P99 query latency: 27.859712ms
RunConcurrentQueryStoreTest..

=== Concurrent Query/Store Test ===
Pre-populating database with 5000 events for concurrent query/store test...
Concurrent test completed: 235023 operations (185023 queries, 50000 writes) in 1m0.005568823s
Operations/sec: 3916.69
Avg latency: 2.401379ms
Avg query latency: 2.672573ms
Avg write latency: 1.397837ms
P95 latency: 4.398002ms
P99 latency: 6.207183ms

Pausing 10s before next round...

=== Test round completed ===


=== Starting test round 2/2 ===
RunPeakThroughputTest..

=== Peak Throughput Test ===
Events saved: 50000/50000 (100.0%)
Duration: 5.127096799s
Events/sec: 9752.11
Avg latency: 1.795821ms
P90 latency: 2.25461ms
P95 latency: 2.466785ms
P99 latency: 3.159176ms
Bottom 10% Avg latency: 3.072242ms
RunBurstPatternTest..

=== Burst Pattern Test ===
Burst completed: 5000 events in 358.012209ms
Burst completed: 5000 events in 336.300441ms
Burst completed: 5000 events in 363.657063ms
Burst completed: 5000 events in 356.771817ms
Burst completed: 5000 events in 368.000986ms
Burst completed: 5000 events in 441.821658ms
Burst completed: 5000 events in 451.146122ms
Burst completed: 5000 events in 455.159014ms
Burst completed: 5000 events in 359.826504ms
Burst completed: 5000 events in 358.602207ms
1763396835570723ℹ️ /tmp/benchmark_next-orly-dgraph_8: [6] [E] LOG Compact 0->6 (8, 0 -> 4 tables with 1 splits). [00001 00002 00003 00004 00005 00006 00007 00008 . .] -> [00009 00010 00011 00012 .], took 3.055s
, deleted 1901003 bytes
/go/pkg/mod/github.com/dgraph-io/badger/v4@v4.8.0/levels.go:1479 /build/pkg/database/logger.go:56
Burst test completed: 50000 events in 10.25458455s
Events/sec: 4875.87
RunMixedReadWriteTest..

=== Mixed Read/Write Test ===
Pre-populating database for read tests...
Mixed test completed: 25000 writes, 25000 reads in 24.474786024s
Combined ops/sec: 2042.92
RunQueryTest..

=== Query Test ===
Pre-populating database with 10000 events for query tests...
Query test completed: 287727 queries in 1m0.012156857s
Queries/sec: 4794.48
Avg query latency: 3.504598ms
P95 query latency: 11.416502ms
P99 query latency: 19.871886ms
RunConcurrentQueryStoreTest..

=== Concurrent Query/Store Test ===
Pre-populating database with 5000 events for concurrent query/store test...
1763396960566384ℹ️ /tmp/benchmark_next-orly-dgraph_8: Block cache metrics: hit: 436764091 miss: 4871096 keys-added: 1584381 keys-updated: 2919606 keys-evicted: 1584361 cost-added: 83226283032882 cost-evicted: 83225259887553 sets-dropped: 0 sets-rejected: 305847 gets-dropped: 344794880 gets-kept: 96734656 gets-total: 441635219 hit-ratio: 0.99
/go/pkg/mod/github.com/dgraph-io/badger/v4@v4.8.0/db.go:454 /build/pkg/database/logger.go:56
Concurrent test completed: 252209 operations (202209 queries, 50000 writes) in 1m0.008028818s
Operations/sec: 4202.92
Avg latency: 2.189461ms
Avg query latency: 2.337704ms
Avg write latency: 1.58994ms
P95 latency: 3.919323ms
P99 latency: 5.959314ms

=== Test round completed ===


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

Test: Peak Throughput
Duration: 4.932431923s
Total Events: 50000
Events/sec: 10136.99
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 432 MB
Avg Latency: 1.667317ms
P90 Latency: 2.069461ms
P95 Latency: 2.249895ms
P99 Latency: 2.861303ms
Bottom 10% Avg Latency: 2.592597ms
----------------------------------------

Test: Burst Pattern
Duration: 9.808342155s
Total Events: 50000
Events/sec: 5097.70
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 149 MB
Avg Latency: 3.805495ms
P90 Latency: 6.632151ms
P95 Latency: 8.069195ms
P99 Latency: 13.244195ms
Bottom 10% Avg Latency: 9.922762ms
----------------------------------------

Test: Mixed Read/Write
Duration: 24.59623701s
Total Events: 50000
Events/sec: 2032.83
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 121 MB
Avg Latency: 467.746µs
P90 Latency: 911.189µs
P95 Latency: 1.018554ms
P99 Latency: 1.250848ms
Bottom 10% Avg Latency: 1.345857ms
----------------------------------------

Test: Query Performance
Duration: 1m0.014161671s
Total Events: 221626
Events/sec: 3692.90
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 125 MB
Avg Latency: 4.849059ms
P90 Latency: 10.564822ms
P95 Latency: 15.966874ms
P99 Latency: 27.859712ms
Bottom 10% Avg Latency: 18.180391ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.005568823s
Total Events: 235023
Events/sec: 3916.69
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 177 MB
Avg Latency: 2.401379ms
P90 Latency: 3.659643ms
P95 Latency: 4.398002ms
P99 Latency: 6.207183ms
Bottom 10% Avg Latency: 4.857955ms
----------------------------------------

Test: Peak Throughput
Duration: 5.127096799s
Total Events: 50000
Events/sec: 9752.11
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 480 MB
Avg Latency: 1.795821ms
P90 Latency: 2.25461ms
P95 Latency: 2.466785ms
P99 Latency: 3.159176ms
Bottom 10% Avg Latency: 3.072242ms
----------------------------------------

Test: Burst Pattern
Duration: 10.25458455s
Total Events: 50000
Events/sec: 4875.87
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 621 MB
Avg Latency: 9.266976ms
P90 Latency: 24.12544ms
P95 Latency: 34.465042ms
P99 Latency: 55.446215ms
Bottom 10% Avg Latency: 37.317916ms
----------------------------------------

Test: Mixed Read/Write
Duration: 24.474786024s
Total Events: 50000
Events/sec: 2042.92
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 182 MB
Avg Latency: 452.46µs
P90 Latency: 909.806µs
P95 Latency: 1.014516ms
P99 Latency: 1.214797ms
Bottom 10% Avg Latency: 1.304994ms
----------------------------------------

Test: Query Performance
Duration: 1m0.012156857s
Total Events: 287727
Events/sec: 4794.48
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 150 MB
Avg Latency: 3.504598ms
P90 Latency: 7.480817ms
P95 Latency: 11.416502ms
P99 Latency: 19.871886ms
Bottom 10% Avg Latency: 12.934864ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.008028818s
Total Events: 252209
Events/sec: 4202.92
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 98 MB
Avg Latency: 2.189461ms
P90 Latency: 3.213337ms
P95 Latency: 3.919323ms
P99 Latency: 5.959314ms
Bottom 10% Avg Latency: 4.521426ms
----------------------------------------

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
1763397010410098ℹ️ /tmp/benchmark_next-orly-dgraph_8: Lifetime L0 stalled for: 0s
/go/pkg/mod/github.com/dgraph-io/badger/v4@v4.8.0/db.go:536 /build/pkg/database/logger.go:56
1763397011943178ℹ️ /tmp/benchmark_next-orly-dgraph_8: 
Level 0 [ ]: NumTables: 00. Size: 0 B of 0 B. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 61 MiB
Level 1 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 61 MiB
Level 2 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 61 MiB
Level 3 [ ]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 61 MiB
Level 4 [B]: NumTables: 00. Size: 0 B of 10 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 61 MiB
Level 5 [ ]: NumTables: 01. Size: 94 MiB of 23 MiB. Score: 4.08->4.08 StaleData: 0 B Target FileSize: 122 MiB
Level 6 [ ]: NumTables: 04. Size: 230 MiB of 230 MiB. Score: 0.00->0.00 StaleData: 0 B Target FileSize: 244 MiB
Level Done
/go/pkg/mod/github.com/dgraph-io/badger/v4@v4.8.0/db.go:615 /build/pkg/database/logger.go:56

RELAY_NAME: next-orly-dgraph
RELAY_URL: ws://next-orly-dgraph:8080
TEST_TIMESTAMP: 2025-11-17T16:30:12+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
