khatru-sqlite_results.txt raw
1 Starting Nostr Relay Benchmark (Badger Backend)
2 Data Directory: /tmp/benchmark_khatru-sqlite_8
3 Events: 50000, Workers: 24, Duration: 1m0s
4 1764143261406084ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66
5 1764143261406169ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73
6 1764143261406201ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80
7 1764143261406210ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:294
8 1764143261406219ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:339
9 1764143261406234ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87
10 1764143261406240ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:347
11 1764143261406256ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:436
12 1764143261406263ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:545
13 1764143261406285ℹ️ migrating to version 5... /build/pkg/database/migrations.go:94
14 1764143261406291ℹ️ re-encoding events with optimized tag binary format... /build/pkg/database/migrations.go:552
15 1764143261406310ℹ️ found 0 events with e/p tags to re-encode /build/pkg/database/migrations.go:639
16 1764143261406315ℹ️ 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:47:41 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: 2.980541518s
29 Events/sec: 16775.48
30 Avg latency: 1.316097ms
31 P90 latency: 1.75215ms
32 P95 latency: 2.019999ms
33 P99 latency: 2.884086ms
34 Bottom 10% Avg latency: 743.925µs
35 Wiping database between tests...
36 RunBurstPatternTest (Badger)..
37
38 === Burst Pattern Test ===
39 Burst completed: 5000 events in 294.559368ms
40 Burst completed: 5000 events in 338.351868ms
41 Burst completed: 5000 events in 289.64343ms
42 Burst completed: 5000 events in 418.427743ms
43 Burst completed: 5000 events in 337.294837ms
44 Burst completed: 5000 events in 359.624702ms
45 Burst completed: 5000 events in 307.791949ms
46 Burst completed: 5000 events in 284.861295ms
47 Burst completed: 5000 events in 314.638569ms
48 Burst completed: 5000 events in 274.271908ms
49 Burst test completed: 50000 events in 8.227316527s, errors: 0
50 Events/sec: 6077.32
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.361629597s
69 Combined ops/sec: 2052.41
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: 369485 queries in 1m0.007598809s
82 Queries/sec: 6157.30
83 Avg query latency: 1.851496ms
84 P95 query latency: 7.629059ms
85 P99 query latency: 11.579084ms
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: 307591 operations (257591 queries, 50000 writes) in 1m0.003842232s
104 Operations/sec: 5126.19
105 Avg latency: 1.567905ms
106 Avg query latency: 1.520146ms
107 Avg write latency: 1.813947ms
108 P95 latency: 4.080054ms
109 P99 latency: 7.252873ms
110
111 === Badger benchmark completed ===
112
113
114 ================================================================================
115 BENCHMARK REPORT
116 ================================================================================
117
118 Test: Peak Throughput
119 Duration: 2.980541518s
120 Total Events: 50000
121 Events/sec: 16775.48
122 Success Rate: 100.0%
123 Concurrent Workers: 24
124 Memory Used: 205 MB
125 Avg Latency: 1.316097ms
126 P90 Latency: 1.75215ms
127 P95 Latency: 2.019999ms
128 P99 Latency: 2.884086ms
129 Bottom 10% Avg Latency: 743.925µs
130 ----------------------------------------
131
132 Test: Burst Pattern
133 Duration: 8.227316527s
134 Total Events: 50000
135 Events/sec: 6077.32
136 Success Rate: 100.0%
137 Concurrent Workers: 24
138 Memory Used: 206 MB
139 Avg Latency: 1.448816ms
140 P90 Latency: 2.065115ms
141 P95 Latency: 2.415349ms
142 P99 Latency: 3.441514ms
143 Bottom 10% Avg Latency: 642.527µs
144 ----------------------------------------
145
146 Test: Mixed Read/Write
147 Duration: 24.361629597s
148 Total Events: 50000
149 Events/sec: 2052.41
150 Success Rate: 100.0%
151 Concurrent Workers: 24
152 Memory Used: 170 MB
153 Avg Latency: 395.815µs
154 P90 Latency: 821.619µs
155 P95 Latency: 915.807µs
156 P99 Latency: 1.137015ms
157 Bottom 10% Avg Latency: 1.044106ms
158 ----------------------------------------
159
160 Test: Query Performance
161 Duration: 1m0.007598809s
162 Total Events: 369485
163 Events/sec: 6157.30
164 Success Rate: 100.0%
165 Concurrent Workers: 24
166 Memory Used: 97 MB
167 Avg Latency: 1.851496ms
168 P90 Latency: 5.786274ms
169 P95 Latency: 7.629059ms
170 P99 Latency: 11.579084ms
171 Bottom 10% Avg Latency: 8.382865ms
172 ----------------------------------------
173
174 Test: Concurrent Query/Store
175 Duration: 1m0.003842232s
176 Total Events: 307591
177 Events/sec: 5126.19
178 Success Rate: 100.0%
179 Concurrent Workers: 24
180 Memory Used: 143 MB
181 Avg Latency: 1.567905ms
182 P90 Latency: 3.141841ms
183 P95 Latency: 4.080054ms
184 P99 Latency: 7.252873ms
185 Bottom 10% Avg Latency: 4.875018ms
186 ----------------------------------------
187
188 Report saved to: /tmp/benchmark_khatru-sqlite_8/benchmark_report.txt
189 AsciiDoc report saved to: /tmp/benchmark_khatru-sqlite_8/benchmark_report.adoc
190
191 RELAY_NAME: khatru-sqlite
192 RELAY_URL: ws://khatru-sqlite:3334
193 TEST_TIMESTAMP: 2025-11-26T07:50:58+00:00
194 BENCHMARK_CONFIG:
195 Events: 50000
196 Workers: 24
197 Duration: 60s
198