Starting Nostr Relay Benchmark
Data Directory: /tmp/benchmark_next-orly-badger_8
Events: 50000, Workers: 24, Duration: 1m0s
1763396182850462ℹ️ /tmp/benchmark_next-orly-badger_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
1763396182853668ℹ️ /tmp/benchmark_next-orly-badger_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
1763396182853712ℹ️ /tmp/benchmark_next-orly-badger_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
1763396182854009ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
1763396182854056ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
1763396182854078ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
1763396182854082ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287
1763396182854129ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332
1763396182854260ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
1763396182854271ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340
1763396182854295ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429
1763396182854302ℹ️ 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:16:22 INFO: Successfully loaded libsecp256k1 v5.0.0 from libsecp256k1.so.2
1763396184854370ℹ️ /tmp/benchmark_next-orly-badger_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: 5.666497805s
Events/sec: 8823.79
Avg latency: 2.020722ms
P90 latency: 2.645436ms
P95 latency: 2.995948ms
P99 latency: 4.460502ms
Bottom 10% Avg latency: 3.520179ms
RunBurstPatternTest..

=== Burst Pattern Test ===
Burst completed: 5000 events in 352.025605ms
Burst completed: 5000 events in 363.623929ms
Burst completed: 5000 events in 367.475139ms
Burst completed: 5000 events in 396.276199ms
Burst completed: 5000 events in 334.007635ms
Burst completed: 5000 events in 342.086817ms
Burst completed: 5000 events in 360.687805ms
Burst completed: 5000 events in 392.627451ms
Burst completed: 5000 events in 397.635203ms
Burst completed: 5000 events in 376.061572ms
Burst test completed: 50000 events in 10.132858185s
Events/sec: 4934.44
RunMixedReadWriteTest..

=== Mixed Read/Write Test ===
Pre-populating database for read tests...
1763396242843490ℹ️ /tmp/benchmark_next-orly-badger_8: Block cache metrics: hit: 232171 miss: 337826 keys-added: 235144 keys-updated: 89642 keys-evicted: 235124 cost-added: 12615246695866 cost-evicted: 12614243474391 sets-dropped: 0 sets-rejected: 12961 gets-dropped: 1280 gets-kept: 568192 gets-total: 569997 hit-ratio: 0.41
/go/pkg/mod/github.com/dgraph-io/badger/v4@v4.8.0/db.go:454 /build/pkg/database/logger.go:56
Mixed test completed: 25000 writes, 25000 reads in 24.625333257s
Combined ops/sec: 2030.43
RunQueryTest..

=== Query Test ===
Pre-populating database with 10000 events for query tests...
Query test completed: 197562 queries in 1m0.011972513s
Queries/sec: 3292.04
Avg query latency: 5.52205ms
P95 query latency: 18.40165ms
P99 query latency: 32.139723ms
RunConcurrentQueryStoreTest..

=== Concurrent Query/Store Test ===
Pre-populating database with 5000 events for concurrent query/store test...
Concurrent test completed: 224870 operations (174870 queries, 50000 writes) in 1m0.006047854s
Operations/sec: 3747.46
Avg latency: 2.665369ms
Avg query latency: 2.866192ms
Avg write latency: 1.963009ms
P95 latency: 5.204253ms
P99 latency: 8.129537ms

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.145620568s
Events/sec: 9717.00
Avg latency: 1.788996ms
P90 latency: 2.241725ms
P95 latency: 2.442669ms
P99 latency: 3.110506ms
Bottom 10% Avg latency: 3.016821ms
RunBurstPatternTest..

=== Burst Pattern Test ===
Burst completed: 5000 events in 362.292309ms
Burst completed: 5000 events in 446.105376ms
Burst completed: 5000 events in 414.443306ms
Burst completed: 5000 events in 378.792051ms
Burst completed: 5000 events in 381.274883ms
Burst completed: 5000 events in 397.941224ms
Burst completed: 5000 events in 449.109795ms
Burst completed: 5000 events in 410.566974ms
Burst completed: 5000 events in 385.220958ms
Burst completed: 5000 events in 383.149443ms
1763396419122547ℹ️ /tmp/benchmark_next-orly-badger_8: [0] [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.061s
, deleted 1899050 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.438224172s
Events/sec: 4790.09
RunMixedReadWriteTest..

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

=== Query Test ===
Pre-populating database with 10000 events for query tests...
Query test completed: 293294 queries in 1m0.013023948s
Queries/sec: 4887.17
Avg query latency: 3.408294ms
P95 query latency: 10.965419ms
P99 query latency: 19.184675ms
RunConcurrentQueryStoreTest..

=== Concurrent Query/Store Test ===
Pre-populating database with 5000 events for concurrent query/store test...
1763396542843038ℹ️ /tmp/benchmark_next-orly-badger_8: Block cache metrics: hit: 411640922 miss: 5406705 keys-added: 1627143 keys-updated: 3422501 keys-evicted: 1627125 cost-added: 84304242021549 cost-evicted: 84303233712402 sets-dropped: 0 sets-rejected: 295382 gets-dropped: 325582080 gets-kept: 91360192 gets-total: 417047650 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: 254899 operations (204899 queries, 50000 writes) in 1m0.006656731s
Operations/sec: 4247.85
Avg latency: 2.125728ms
Avg query latency: 2.314927ms
Avg write latency: 1.350394ms
P95 latency: 3.778776ms
P99 latency: 5.393909ms

=== Test round completed ===


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

Test: Peak Throughput
Duration: 5.666497805s
Total Events: 50000
Events/sec: 8823.79
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 257 MB
Avg Latency: 2.020722ms
P90 Latency: 2.645436ms
P95 Latency: 2.995948ms
P99 Latency: 4.460502ms
Bottom 10% Avg Latency: 3.520179ms
----------------------------------------

Test: Burst Pattern
Duration: 10.132858185s
Total Events: 50000
Events/sec: 4934.44
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 122 MB
Avg Latency: 7.197024ms
P90 Latency: 12.546513ms
P95 Latency: 15.216454ms
P99 Latency: 23.682573ms
Bottom 10% Avg Latency: 18.172083ms
----------------------------------------

Test: Mixed Read/Write
Duration: 24.625333257s
Total Events: 50000
Events/sec: 2030.43
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 120 MB
Avg Latency: 467.389µs
P90 Latency: 914.891µs
P95 Latency: 1.0349ms
P99 Latency: 1.268268ms
Bottom 10% Avg Latency: 1.393626ms
----------------------------------------

Test: Query Performance
Duration: 1m0.011972513s
Total Events: 197562
Events/sec: 3292.04
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 152 MB
Avg Latency: 5.52205ms
P90 Latency: 12.226879ms
P95 Latency: 18.40165ms
P99 Latency: 32.139723ms
Bottom 10% Avg Latency: 20.985445ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.006047854s
Total Events: 224870
Events/sec: 3747.46
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 127 MB
Avg Latency: 2.665369ms
P90 Latency: 4.194993ms
P95 Latency: 5.204253ms
P99 Latency: 8.129537ms
Bottom 10% Avg Latency: 5.884586ms
----------------------------------------

Test: Peak Throughput
Duration: 5.145620568s
Total Events: 50000
Events/sec: 9717.00
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 522 MB
Avg Latency: 1.788996ms
P90 Latency: 2.241725ms
P95 Latency: 2.442669ms
P99 Latency: 3.110506ms
Bottom 10% Avg Latency: 3.016821ms
----------------------------------------

Test: Burst Pattern
Duration: 10.438224172s
Total Events: 50000
Events/sec: 4790.09
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 623 MB
Avg Latency: 9.406859ms
P90 Latency: 21.810715ms
P95 Latency: 35.119382ms
P99 Latency: 66.001509ms
Bottom 10% Avg Latency: 39.782175ms
----------------------------------------

Test: Mixed Read/Write
Duration: 24.485622359s
Total Events: 50000
Events/sec: 2042.01
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 165 MB
Avg Latency: 445.318µs
P90 Latency: 907.915µs
P95 Latency: 1.021172ms
P99 Latency: 1.227095ms
Bottom 10% Avg Latency: 1.265835ms
----------------------------------------

Test: Query Performance
Duration: 1m0.013023948s
Total Events: 293294
Events/sec: 4887.17
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 136 MB
Avg Latency: 3.408294ms
P90 Latency: 7.156129ms
P95 Latency: 10.965419ms
P99 Latency: 19.184675ms
Bottom 10% Avg Latency: 12.469832ms
----------------------------------------

Test: Concurrent Query/Store
Duration: 1m0.006656731s
Total Events: 254899
Events/sec: 4247.85
Success Rate: 100.0%
Concurrent Workers: 24
Memory Used: 147 MB
Avg Latency: 2.125728ms
P90 Latency: 3.131901ms
P95 Latency: 3.778776ms
P99 Latency: 5.393909ms
Bottom 10% Avg Latency: 4.22837ms
----------------------------------------

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
1763396593981772ℹ️ /tmp/benchmark_next-orly-badger_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
1763396595378747ℹ️ /tmp/benchmark_next-orly-badger_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-badger
RELAY_URL: ws://next-orly-badger:8080
TEST_TIMESTAMP: 2025-11-17T16:23:15+00:00
BENCHMARK_CONFIG:
  Events: 50000
  Workers: 24
  Duration: 60s
