add dgraph backend to benchmark suite with safe type assertions for multi-backend support

This commit is contained in:
2025-11-17 16:52:38 +00:00
parent 86481a42e8
commit 038d1959ed
26 changed files with 2717 additions and 186 deletions

View File

@@ -0,0 +1,134 @@
Starting Nostr Relay Benchmark
Data Directory: /tmp/benchmark_next-orly_8
Events: 50000, Workers: 24, Duration: 1m0s
1763394450181444 /tmp/benchmark_next-orly_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
1763394450184981 /tmp/benchmark_next-orly_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
1763394450185044 /tmp/benchmark_next-orly_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
1763394450185315 migrating to version 1... /build/pkg/database/migrations.go:66
1763394450185349 migrating to version 2... /build/pkg/database/migrations.go:73
1763394450185369 migrating to version 3... /build/pkg/database/migrations.go:80
1763394450185374 cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287
1763394450185381 cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332
1763394450185396 migrating to version 4... /build/pkg/database/migrations.go:87
1763394450185400 converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340
1763394450185410 found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429
1763394450185415 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 15:47:30 INFO: Successfully loaded libsecp256k1 v5.0.0 from libsecp256k1.so.2
1763394452185466 /tmp/benchmark_next-orly_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.816237891s
Events/sec: 10381.55
Avg latency: 1.655686ms
P90 latency: 2.061483ms
P95 latency: 2.348178ms
P99 latency: 3.856522ms
Bottom 10% Avg latency: 2.985064ms
RunBurstPatternTest..
=== Burst Pattern Test ===
Burst completed: 5000 events in 308.793395ms
Burst completed: 5000 events in 320.69366ms
Burst completed: 5000 events in 324.127721ms
Burst completed: 5000 events in 342.594802ms
Burst completed: 5000 events in 302.350819ms
Burst completed: 5000 events in 309.16143ms
Burst completed: 5000 events in 306.739193ms
Burst completed: 5000 events in 329.275972ms
Burst completed: 5000 events in 329.234395ms
Burst completed: 5000 events in 348.105403ms
Burst test completed: 50000 events in 9.543815189s
Events/sec: 5238.99
RunMixedReadWriteTest..
=== Mixed Read/Write Test ===
Pre-populating database for read tests...
Mixed test completed: 25000 writes, 25000 reads in 24.491349518s
Combined ops/sec: 2041.54
1763394510174043 /tmp/benchmark_next-orly_8: Block cache metrics: hit: 248593 miss: 322620 keys-added: 236208 keys-updated: 73483 keys-evicted: 236188 cost-added: 12658387393408 cost-evicted: 12657366958988 sets-dropped: 0 sets-rejected: 12869 gets-dropped: 64 gets-kept: 570624 gets-total: 571213 hit-ratio: 0.44
/go/pkg/mod/github.com/dgraph-io/badger/v4@v4.8.0/db.go:454 /build/pkg/database/logger.go:56
RunQueryTest..
=== Query Test ===
Pre-populating database with 10000 events for query tests...
Query test completed: 258436 queries in 1m0.014042961s
Queries/sec: 4306.26
Avg query latency: 4.008354ms
P95 query latency: 12.985167ms
P99 query latency: 23.424372ms
RunConcurrentQueryStoreTest..
=== Concurrent Query/Store Test ===
Pre-populating database with 5000 events for concurrent query/store test...
Concurrent test completed: 252445 operations (202445 queries, 50000 writes) in 1m0.005913119s
Operations/sec: 4207.00
Avg latency: 2.121776ms
Avg query latency: 2.374689ms
Avg write latency: 1.097756ms
P95 latency: 3.545393ms
P99 latency: 4.795537ms
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.086723437s
Events/sec: 9829.51
Avg latency: 1.777699ms
P90 latency: 2.219786ms
P95 latency: 2.443201ms
P99 latency: 3.504646ms
Bottom 10% Avg latency: 3.103013ms
RunBurstPatternTest..
=== Burst Pattern Test ===
Burst completed: 5000 events in 324.341799ms
Burst completed: 5000 events in 319.047042ms
Burst completed: 5000 events in 324.104589ms
Burst completed: 5000 events in 342.464953ms
Burst completed: 5000 events in 342.679451ms
Burst completed: 5000 events in 359.150337ms
Burst completed: 5000 events in 367.952516ms
Burst completed: 5000 events in 338.4073ms
Burst completed: 5000 events in 326.796197ms
Burst completed: 5000 events in 357.71787ms
Burst test completed: 50000 events in 9.769325434s
Events/sec: 5118.06
1763394684274617 /tmp/benchmark_next-orly_8: [4] [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 2.954s
, deleted 1904950 bytes
/go/pkg/mod/github.com/dgraph-io/badger/v4@v4.8.0/levels.go:1479 /build/pkg/database/logger.go:56
RunMixedReadWriteTest..
=== Mixed Read/Write Test ===
Pre-populating database for read tests...
Mixed test completed: 25000 writes, 25000 reads in 24.464062793s
Combined ops/sec: 2043.81
RunQueryTest..
=== Query Test ===
Pre-populating database with 10000 events for query tests...
Query test completed: 293040 queries in 1m0.010621036s
Queries/sec: 4883.14
Avg query latency: 3.419764ms
P95 query latency: 11.042876ms
P99 query latency: 19.984912ms
RunConcurrentQueryStoreTest..
=== Concurrent Query/Store Test ===
Pre-populating database with 5000 events for concurrent query/store test...
1763394810173629 /tmp/benchmark_next-orly_8: Block cache metrics: hit: 517421289 miss: 4606293 keys-added: 1664534 keys-updated: 2530425 keys-evicted: 1664512 cost-added: 85045328540032 cost-evicted: 85044318079141 sets-dropped: 0 sets-rejected: 349798 gets-dropped: 404194112 gets-kept: 117717888 gets-total: 522027608 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