khatru-badger_results.txt raw
1 Starting Nostr Relay Benchmark (Badger Backend)
2 Data Directory: /tmp/benchmark_khatru-badger_8
3 Events: 50000, Workers: 24, Duration: 1m0s
4 1764143463950443ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
5 1764143463950524ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
6 1764143463950554ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
7 1764143463950562ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:294
8 1764143463950601ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:339
9 1764143463950677ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
10 1764143463950693ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:347
11 1764143463950707ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:436
12 1764143463950715ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:545
13 1764143463950741ℹ️ migrating to version 5... /build/pkg/database/migrations.go:94
14 1764143463950748ℹ️ re-encoding events with optimized tag binary format... /build/pkg/database/migrations.go:552
15 1764143463950772ℹ️ found 0 events with e/p tags to re-encode /build/pkg/database/migrations.go:639
16 1764143463950779ℹ️ no events need re-encoding /build/pkg/database/migrations.go:642
17
18 ╔════════════════════════════════════════════════════════╗
19 ║ BADGER BACKEND BENCHMARK SUITE ║
20 ╚════════════════════════════════════════════════════════╝
21
22 === Starting Badger benchmark ===
23 RunPeakThroughputTest (Badger)..
24
25 === Peak Throughput Test ===
26 2025/11/26 07:51:03 INFO: Successfully loaded embedded libsecp256k1 v5.0.0 from /tmp/orly-libsecp256k1/libsecp256k1.so
27 Events saved: 50000/50000 (100.0%), errors: 0
28 Duration: 3.430851381s
29 Events/sec: 14573.64
30 Avg latency: 1.582659ms
31 P90 latency: 2.208413ms
32 P95 latency: 2.584156ms
33 P99 latency: 3.989364ms
34 Bottom 10% Avg latency: 849.196µs
35 Wiping database between tests...
36 RunBurstPatternTest (Badger)..
37
38 === Burst Pattern Test ===
39 Burst completed: 5000 events in 327.135579ms
40 Burst completed: 5000 events in 347.321999ms
41 Burst completed: 5000 events in 293.638919ms
42 Burst completed: 5000 events in 315.213974ms
43 Burst completed: 5000 events in 293.822691ms
44 Burst completed: 5000 events in 393.17551ms
45 Burst completed: 5000 events in 317.689223ms
46 Burst completed: 5000 events in 283.629668ms
47 Burst completed: 5000 events in 306.891378ms
48 Burst completed: 5000 events in 281.684719ms
49 Burst test completed: 50000 events in 8.165107452s, errors: 0
50 Events/sec: 6123.62
51 Wiping database between tests...
52 RunMixedReadWriteTest (Badger)..
53
54 === Mixed Read/Write Test ===
55 Generating 1000 unique synthetic events (minimum 300 bytes each)...
56 Generated 1000 events:
57 Average content size: 312 bytes
58 All events are unique (incremental timestamps)
59 All events are properly signed
60
61 Pre-populating database for read tests...
62 Generating 50000 unique synthetic events (minimum 300 bytes each)...
63 Generated 50000 events:
64 Average content size: 314 bytes
65 All events are unique (incremental timestamps)
66 All events are properly signed
67
68 Mixed test completed: 25000 writes, 25000 reads in 24.414376807s
69 Combined ops/sec: 2047.97
70 Wiping database between tests...
71 RunQueryTest (Badger)..
72
73 === Query Test ===
74 Generating 10000 unique synthetic events (minimum 300 bytes each)...
75 Generated 10000 events:
76 Average content size: 313 bytes
77 All events are unique (incremental timestamps)
78 All events are properly signed
79
80 Pre-populating database with 10000 events for query tests...
81 Query test completed: 367781 queries in 1m0.004424256s
82 Queries/sec: 6129.23
83 Avg query latency: 1.861418ms
84 P95 query latency: 7.652288ms
85 P99 query latency: 11.670769ms
86 Wiping database between tests...
87 RunConcurrentQueryStoreTest (Badger)..
88
89 === Concurrent Query/Store Test ===
90 Generating 5000 unique synthetic events (minimum 300 bytes each)...
91 Generated 5000 events:
92 Average content size: 313 bytes
93 All events are unique (incremental timestamps)
94 All events are properly signed
95
96 Pre-populating database with 5000 events for concurrent query/store test...
97 Generating 50000 unique synthetic events (minimum 300 bytes each)...
98 Generated 50000 events:
99 Average content size: 314 bytes
100 All events are unique (incremental timestamps)
101 All events are properly signed
102
103 Concurrent test completed: 307708 operations (257708 queries, 50000 writes) in 1m0.003628582s
104 Operations/sec: 5128.16
105 Avg latency: 1.520953ms
106 Avg query latency: 1.503959ms
107 Avg write latency: 1.608546ms
108 P95 latency: 3.958904ms
109 P99 latency: 6.227011ms
110
111 === Badger benchmark completed ===
112
113
114 ================================================================================
115 BENCHMARK REPORT
116 ================================================================================
117
118 Test: Peak Throughput
119 Duration: 3.430851381s
120 Total Events: 50000
121 Events/sec: 14573.64
122 Success Rate: 100.0%
123 Concurrent Workers: 24
124 Memory Used: 102 MB
125 Avg Latency: 1.582659ms
126 P90 Latency: 2.208413ms
127 P95 Latency: 2.584156ms
128 P99 Latency: 3.989364ms
129 Bottom 10% Avg Latency: 849.196µs
130 ----------------------------------------
131
132 Test: Burst Pattern
133 Duration: 8.165107452s
134 Total Events: 50000
135 Events/sec: 6123.62
136 Success Rate: 100.0%
137 Concurrent Workers: 24
138 Memory Used: 211 MB
139 Avg Latency: 1.42045ms
140 P90 Latency: 1.976894ms
141 P95 Latency: 2.297743ms
142 P99 Latency: 3.397761ms
143 Bottom 10% Avg Latency: 671.897µs
144 ----------------------------------------
145
146 Test: Mixed Read/Write
147 Duration: 24.414376807s
148 Total Events: 50000
149 Events/sec: 2047.97
150 Success Rate: 100.0%
151 Concurrent Workers: 24
152 Memory Used: 134 MB
153 Avg Latency: 390.225µs
154 P90 Latency: 811.651µs
155 P95 Latency: 911.2µs
156 P99 Latency: 1.140536ms
157 Bottom 10% Avg Latency: 1.056491ms
158 ----------------------------------------
159
160 Test: Query Performance
161 Duration: 1m0.004424256s
162 Total Events: 367781
163 Events/sec: 6129.23
164 Success Rate: 100.0%
165 Concurrent Workers: 24
166 Memory Used: 113 MB
167 Avg Latency: 1.861418ms
168 P90 Latency: 5.800639ms
169 P95 Latency: 7.652288ms
170 P99 Latency: 11.670769ms
171 Bottom 10% Avg Latency: 8.426888ms
172 ----------------------------------------
173
174 Test: Concurrent Query/Store
175 Duration: 1m0.003628582s
176 Total Events: 307708
177 Events/sec: 5128.16
178 Success Rate: 100.0%
179 Concurrent Workers: 24
180 Memory Used: 100 MB
181 Avg Latency: 1.520953ms
182 P90 Latency: 3.075583ms
183 P95 Latency: 3.958904ms
184 P99 Latency: 6.227011ms
185 Bottom 10% Avg Latency: 4.506519ms
186 ----------------------------------------
187
188 Report saved to: /tmp/benchmark_khatru-badger_8/benchmark_report.txt
189 AsciiDoc report saved to: /tmp/benchmark_khatru-badger_8/benchmark_report.adoc
190
191 RELAY_NAME: khatru-badger
192 RELAY_URL: ws://khatru-badger:3334
193 TEST_TIMESTAMP: 2025-11-26T07:54:21+00:00
194 BENCHMARK_CONFIG:
195 Events: 50000
196 Workers: 24
197 Duration: 60s
198