diff --git a/cmd/benchmark/reports/run_20251119_114143/aggregate_report.txt b/cmd/benchmark/reports/run_20251119_114143/aggregate_report.txt new file mode 100644 index 0000000..67ed43e --- /dev/null +++ b/cmd/benchmark/reports/run_20251119_114143/aggregate_report.txt @@ -0,0 +1,176 @@ +================================================================ +NOSTR RELAY BENCHMARK AGGREGATE REPORT +================================================================ +Generated: 2025-11-19T12:08:43+00:00 +Benchmark Configuration: + Events per test: 50000 + Concurrent workers: 24 + Test duration: 60s + +Relays tested: 8 + +================================================================ +SUMMARY BY RELAY +================================================================ + +Relay: next-orly-badger +---------------------------------------- +Status: COMPLETED +Events/sec: 17949.86 +Events/sec: 6293.77 +Events/sec: 17949.86 +Success Rate: 100.0% +Success Rate: 100.0% +Success Rate: 100.0% +Avg Latency: 1.089014ms +Bottom 10% Avg Latency: 552.633µs +Avg Latency: 749.292µs +P95 Latency: 1.801326ms +P95 Latency: 1.544064ms +P95 Latency: 797.32µs + +Relay: next-orly-dgraph +---------------------------------------- +Status: COMPLETED +Events/sec: 17627.19 +Events/sec: 6241.01 +Events/sec: 17627.19 +Success Rate: 100.0% +Success Rate: 100.0% +Success Rate: 100.0% +Avg Latency: 1.103766ms +Bottom 10% Avg Latency: 537.227µs +Avg Latency: 973.956µs +P95 Latency: 1.895983ms +P95 Latency: 1.938364ms +P95 Latency: 839.77µs + +Relay: next-orly-neo4j +---------------------------------------- +Status: COMPLETED +Events/sec: 15536.46 +Events/sec: 6269.18 +Events/sec: 15536.46 +Success Rate: 100.0% +Success Rate: 100.0% +Success Rate: 100.0% +Avg Latency: 1.414281ms +Bottom 10% Avg Latency: 704.384µs +Avg Latency: 919.794µs +P95 Latency: 2.486204ms +P95 Latency: 1.842478ms +P95 Latency: 828.598µs + +Relay: khatru-sqlite +---------------------------------------- +Status: COMPLETED +Events/sec: 17237.90 +Events/sec: 6137.41 +Events/sec: 17237.90 +Success Rate: 100.0% +Success Rate: 100.0% +Success Rate: 100.0% +Avg Latency: 1.195398ms +Bottom 10% Avg Latency: 614.1µs +Avg Latency: 967.476µs +P95 Latency: 2.00684ms +P95 Latency: 2.046996ms +P95 Latency: 843.455µs + +Relay: khatru-badger +---------------------------------------- +Status: COMPLETED +Events/sec: 16911.23 +Events/sec: 6231.83 +Events/sec: 16911.23 +Success Rate: 100.0% +Success Rate: 100.0% +Success Rate: 100.0% +Avg Latency: 1.187112ms +Bottom 10% Avg Latency: 540.572µs +Avg Latency: 957.9µs +P95 Latency: 2.183304ms +P95 Latency: 1.888493ms +P95 Latency: 824.399µs + +Relay: relayer-basic +---------------------------------------- +Status: COMPLETED +Events/sec: 17836.39 +Events/sec: 6270.82 +Events/sec: 17836.39 +Success Rate: 100.0% +Success Rate: 100.0% +Success Rate: 100.0% +Avg Latency: 1.081434ms +Bottom 10% Avg Latency: 525.619µs +Avg Latency: 951.65µs +P95 Latency: 1.853627ms +P95 Latency: 1.779976ms +P95 Latency: 831.883µs + +Relay: strfry +---------------------------------------- +Status: COMPLETED +Events/sec: 16470.06 +Events/sec: 6004.96 +Events/sec: 16470.06 +Success Rate: 100.0% +Success Rate: 100.0% +Success Rate: 100.0% +Avg Latency: 1.261656ms +Bottom 10% Avg Latency: 566.551µs +Avg Latency: 1.02418ms +P95 Latency: 2.241835ms +P95 Latency: 2.314062ms +P95 Latency: 821.493µs + +Relay: nostr-rs-relay +---------------------------------------- +Status: COMPLETED +Events/sec: 16764.35 +Events/sec: 6300.71 +Events/sec: 16764.35 +Success Rate: 100.0% +Success Rate: 100.0% +Success Rate: 100.0% +Avg Latency: 1.245012ms +Bottom 10% Avg Latency: 614.335µs +Avg Latency: 869.47µs +P95 Latency: 2.151312ms +P95 Latency: 1.707251ms +P95 Latency: 816.334µs + + +================================================================ +DETAILED RESULTS +================================================================ + +Individual relay reports are available in: + - /reports/run_20251119_114143/khatru-badger_results.txt + - /reports/run_20251119_114143/khatru-sqlite_results.txt + - /reports/run_20251119_114143/next-orly-badger_results.txt + - /reports/run_20251119_114143/next-orly-dgraph_results.txt + - /reports/run_20251119_114143/next-orly-neo4j_results.txt + - /reports/run_20251119_114143/nostr-rs-relay_results.txt + - /reports/run_20251119_114143/relayer-basic_results.txt + - /reports/run_20251119_114143/strfry_results.txt + +================================================================ +BENCHMARK COMPARISON TABLE +================================================================ + +Relay Status Peak Tput/s Avg Latency Success Rate +---- ------ ----------- ----------- ------------ +next-orly-badger OK 17949.86 1.089014ms 100.0% +next-orly-dgraph OK 17627.19 1.103766ms 100.0% +next-orly-neo4j OK 15536.46 1.414281ms 100.0% +khatru-sqlite OK 17237.90 1.195398ms 100.0% +khatru-badger OK 16911.23 1.187112ms 100.0% +relayer-basic OK 17836.39 1.081434ms 100.0% +strfry OK 16470.06 1.261656ms 100.0% +nostr-rs-relay OK 16764.35 1.245012ms 100.0% + +================================================================ +End of Report +================================================================ diff --git a/cmd/benchmark/reports/run_20251119_114143/khatru-badger_results.txt b/cmd/benchmark/reports/run_20251119_114143/khatru-badger_results.txt new file mode 100644 index 0000000..f4089cc --- /dev/null +++ b/cmd/benchmark/reports/run_20251119_114143/khatru-badger_results.txt @@ -0,0 +1,194 @@ +Starting Nostr Relay Benchmark (Badger Backend) +Data Directory: /tmp/benchmark_khatru-badger_8 +Events: 50000, Workers: 24, Duration: 1m0s +1763553313325488ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66 +1763553313325546ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73 +1763553313325642ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80 +1763553313325681ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287 +1763553313325693ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332 +1763553313325710ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87 +1763553313325715ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340 +1763553313325728ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429 +1763553313325733ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:538 + +╔════════════════════════════════════════════════════════╗ +║ BADGER BACKEND BENCHMARK SUITE ║ +╚════════════════════════════════════════════════════════╝ + +=== Starting Badger benchmark === +RunPeakThroughputTest (Badger).. + +=== Peak Throughput Test === +2025/11/19 11:55:13 WARN: Failed to load embedded library from /tmp/orly-libsecp256k1/libsecp256k1.so: Error relocating /tmp/orly-libsecp256k1/libsecp256k1.so: __fprintf_chk: symbol not found, falling back to system paths +2025/11/19 11:55:13 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2 +Events saved: 50000/50000 (100.0%), errors: 0 +Duration: 2.956615141s +Events/sec: 16911.23 +Avg latency: 1.187112ms +P90 latency: 1.81316ms +P95 latency: 2.183304ms +P99 latency: 3.349323ms +Bottom 10% Avg latency: 540.572µs +Wiping database between tests... +RunBurstPatternTest (Badger).. + +=== Burst Pattern Test === +Burst completed: 5000 events in 287.79724ms +Burst completed: 5000 events in 321.810731ms +Burst completed: 5000 events in 311.674153ms +Burst completed: 5000 events in 318.798198ms +Burst completed: 5000 events in 315.884463ms +Burst completed: 5000 events in 315.046268ms +Burst completed: 5000 events in 302.527406ms +Burst completed: 5000 events in 273.316933ms +Burst completed: 5000 events in 286.042768ms +Burst completed: 5000 events in 284.71424ms +Burst test completed: 50000 events in 8.023322579s, errors: 0 +Events/sec: 6231.83 +Wiping database between tests... +RunMixedReadWriteTest (Badger).. + +=== Mixed Read/Write Test === +Generating 1000 unique synthetic events (minimum 300 bytes each)... +Generated 1000 events: + Average content size: 312 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database for read tests... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Mixed test completed: 25000 writes, 25000 reads in 24.46325201s +Combined ops/sec: 2043.88 +Wiping database between tests... +RunQueryTest (Badger).. + +=== Query Test === +Generating 10000 unique synthetic events (minimum 300 bytes each)... +Generated 10000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 10000 events for query tests... +Query test completed: 419454 queries in 1m0.005159657s +Queries/sec: 6990.30 +Avg query latency: 1.572558ms +P95 query latency: 6.287512ms +P99 query latency: 10.153208ms +Wiping database between tests... +RunConcurrentQueryStoreTest (Badger).. + +=== Concurrent Query/Store Test === +Generating 5000 unique synthetic events (minimum 300 bytes each)... +Generated 5000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 5000 events for concurrent query/store test... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Concurrent test completed: 330203 operations (280203 queries, 50000 writes) in 1m0.002743998s +Operations/sec: 5503.13 +Avg latency: 1.34275ms +Avg query latency: 1.310187ms +Avg write latency: 1.52523ms +P95 latency: 3.461585ms +P99 latency: 6.077333ms + +=== Badger benchmark completed === + + +================================================================================ +BENCHMARK REPORT +================================================================================ + +Test: Peak Throughput +Duration: 2.956615141s +Total Events: 50000 +Events/sec: 16911.23 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 151 MB +Avg Latency: 1.187112ms +P90 Latency: 1.81316ms +P95 Latency: 2.183304ms +P99 Latency: 3.349323ms +Bottom 10% Avg Latency: 540.572µs +---------------------------------------- + +Test: Burst Pattern +Duration: 8.023322579s +Total Events: 50000 +Events/sec: 6231.83 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 294 MB +Avg Latency: 957.9µs +P90 Latency: 1.601517ms +P95 Latency: 1.888493ms +P99 Latency: 2.786201ms +Bottom 10% Avg Latency: 300.141µs +---------------------------------------- + +Test: Mixed Read/Write +Duration: 24.46325201s +Total Events: 50000 +Events/sec: 2043.88 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 134 MB +Avg Latency: 355.539µs +P90 Latency: 738.896µs +P95 Latency: 824.399µs +P99 Latency: 1.026233ms +Bottom 10% Avg Latency: 908.51µs +---------------------------------------- + +Test: Query Performance +Duration: 1m0.005159657s +Total Events: 419454 +Events/sec: 6990.30 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 145 MB +Avg Latency: 1.572558ms +P90 Latency: 4.677831ms +P95 Latency: 6.287512ms +P99 Latency: 10.153208ms +Bottom 10% Avg Latency: 7.079439ms +---------------------------------------- + +Test: Concurrent Query/Store +Duration: 1m0.002743998s +Total Events: 330203 +Events/sec: 5503.13 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 153 MB +Avg Latency: 1.34275ms +P90 Latency: 2.700438ms +P95 Latency: 3.461585ms +P99 Latency: 6.077333ms +Bottom 10% Avg Latency: 4.104549ms +---------------------------------------- + +Report saved to: /tmp/benchmark_khatru-badger_8/benchmark_report.txt +AsciiDoc report saved to: /tmp/benchmark_khatru-badger_8/benchmark_report.adoc + +RELAY_NAME: khatru-badger +RELAY_URL: ws://khatru-badger:3334 +TEST_TIMESTAMP: 2025-11-19T11:58:30+00:00 +BENCHMARK_CONFIG: + Events: 50000 + Workers: 24 + Duration: 60s diff --git a/cmd/benchmark/reports/run_20251119_114143/khatru-sqlite_results.txt b/cmd/benchmark/reports/run_20251119_114143/khatru-sqlite_results.txt new file mode 100644 index 0000000..2faa0f9 --- /dev/null +++ b/cmd/benchmark/reports/run_20251119_114143/khatru-sqlite_results.txt @@ -0,0 +1,194 @@ +Starting Nostr Relay Benchmark (Badger Backend) +Data Directory: /tmp/benchmark_khatru-sqlite_8 +Events: 50000, Workers: 24, Duration: 1m0s +1763553110724756ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66 +1763553110724837ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73 +1763553110724861ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80 +1763553110724868ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287 +1763553110724878ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332 +1763553110724898ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87 +1763553110724903ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340 +1763553110724914ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429 +1763553110724919ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:538 + +╔════════════════════════════════════════════════════════╗ +║ BADGER BACKEND BENCHMARK SUITE ║ +╚════════════════════════════════════════════════════════╝ + +=== Starting Badger benchmark === +RunPeakThroughputTest (Badger).. + +=== Peak Throughput Test === +2025/11/19 11:51:50 WARN: Failed to load embedded library from /tmp/orly-libsecp256k1/libsecp256k1.so: Error relocating /tmp/orly-libsecp256k1/libsecp256k1.so: __fprintf_chk: symbol not found, falling back to system paths +2025/11/19 11:51:50 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2 +Events saved: 50000/50000 (100.0%), errors: 0 +Duration: 2.900585812s +Events/sec: 17237.90 +Avg latency: 1.195398ms +P90 latency: 1.712921ms +P95 latency: 2.00684ms +P99 latency: 2.885171ms +Bottom 10% Avg latency: 614.1µs +Wiping database between tests... +RunBurstPatternTest (Badger).. + +=== Burst Pattern Test === +Burst completed: 5000 events in 291.368683ms +Burst completed: 5000 events in 312.117244ms +Burst completed: 5000 events in 305.378768ms +Burst completed: 5000 events in 311.130855ms +Burst completed: 5000 events in 312.056757ms +Burst completed: 5000 events in 315.153831ms +Burst completed: 5000 events in 355.239066ms +Burst completed: 5000 events in 374.509513ms +Burst completed: 5000 events in 287.00433ms +Burst completed: 5000 events in 277.538432ms +Burst test completed: 50000 events in 8.146754891s, errors: 0 +Events/sec: 6137.41 +Wiping database between tests... +RunMixedReadWriteTest (Badger).. + +=== Mixed Read/Write Test === +Generating 1000 unique synthetic events (minimum 300 bytes each)... +Generated 1000 events: + Average content size: 312 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database for read tests... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Mixed test completed: 25000 writes, 25000 reads in 24.561981494s +Combined ops/sec: 2035.67 +Wiping database between tests... +RunQueryTest (Badger).. + +=== Query Test === +Generating 10000 unique synthetic events (minimum 300 bytes each)... +Generated 10000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 10000 events for query tests... +Query test completed: 416015 queries in 1m0.003485405s +Queries/sec: 6933.18 +Avg query latency: 1.581687ms +P95 query latency: 6.345186ms +P99 query latency: 10.34128ms +Wiping database between tests... +RunConcurrentQueryStoreTest (Badger).. + +=== Concurrent Query/Store Test === +Generating 5000 unique synthetic events (minimum 300 bytes each)... +Generated 5000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 5000 events for concurrent query/store test... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Concurrent test completed: 320691 operations (270691 queries, 50000 writes) in 1m0.002515174s +Operations/sec: 5344.63 +Avg latency: 1.418833ms +Avg query latency: 1.379991ms +Avg write latency: 1.629117ms +P95 latency: 3.787908ms +P99 latency: 6.652821ms + +=== Badger benchmark completed === + + +================================================================================ +BENCHMARK REPORT +================================================================================ + +Test: Peak Throughput +Duration: 2.900585812s +Total Events: 50000 +Events/sec: 17237.90 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 152 MB +Avg Latency: 1.195398ms +P90 Latency: 1.712921ms +P95 Latency: 2.00684ms +P99 Latency: 2.885171ms +Bottom 10% Avg Latency: 614.1µs +---------------------------------------- + +Test: Burst Pattern +Duration: 8.146754891s +Total Events: 50000 +Events/sec: 6137.41 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 328 MB +Avg Latency: 967.476µs +P90 Latency: 1.676611ms +P95 Latency: 2.046996ms +P99 Latency: 3.51994ms +Bottom 10% Avg Latency: 290.612µs +---------------------------------------- + +Test: Mixed Read/Write +Duration: 24.561981494s +Total Events: 50000 +Events/sec: 2035.67 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 170 MB +Avg Latency: 358.339µs +P90 Latency: 746.25µs +P95 Latency: 843.455µs +P99 Latency: 1.070156ms +Bottom 10% Avg Latency: 926.823µs +---------------------------------------- + +Test: Query Performance +Duration: 1m0.003485405s +Total Events: 416015 +Events/sec: 6933.18 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 129 MB +Avg Latency: 1.581687ms +P90 Latency: 4.712679ms +P95 Latency: 6.345186ms +P99 Latency: 10.34128ms +Bottom 10% Avg Latency: 7.16149ms +---------------------------------------- + +Test: Concurrent Query/Store +Duration: 1m0.002515174s +Total Events: 320691 +Events/sec: 5344.63 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 136 MB +Avg Latency: 1.418833ms +P90 Latency: 2.888306ms +P95 Latency: 3.787908ms +P99 Latency: 6.652821ms +Bottom 10% Avg Latency: 4.474409ms +---------------------------------------- + +Report saved to: /tmp/benchmark_khatru-sqlite_8/benchmark_report.txt +AsciiDoc report saved to: /tmp/benchmark_khatru-sqlite_8/benchmark_report.adoc + +RELAY_NAME: khatru-sqlite +RELAY_URL: ws://khatru-sqlite:3334 +TEST_TIMESTAMP: 2025-11-19T11:55:08+00:00 +BENCHMARK_CONFIG: + Events: 50000 + Workers: 24 + Duration: 60s diff --git a/cmd/benchmark/reports/run_20251119_114143/next-orly-badger_results.txt b/cmd/benchmark/reports/run_20251119_114143/next-orly-badger_results.txt new file mode 100644 index 0000000..5fb578f --- /dev/null +++ b/cmd/benchmark/reports/run_20251119_114143/next-orly-badger_results.txt @@ -0,0 +1,195 @@ +Starting Nostr Relay Benchmark (Badger Backend) +Data Directory: /tmp/benchmark_next-orly-badger_8 +Events: 50000, Workers: 24, Duration: 1m0s +1763552503625884ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66 +1763552503625955ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73 +1763552503625976ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80 +1763552503625981ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287 +1763552503625991ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332 +1763552503626007ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87 +1763552503626012ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340 +1763552503626026ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429 +1763552503626033ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:538 + +╔════════════════════════════════════════════════════════╗ +║ BADGER BACKEND BENCHMARK SUITE ║ +╚════════════════════════════════════════════════════════╝ + +=== Starting Badger benchmark === +RunPeakThroughputTest (Badger).. + +=== Peak Throughput Test === +2025/11/19 11:41:43 INFO: Extracted embedded libsecp256k1 to /tmp/orly-libsecp256k1/libsecp256k1.so +2025/11/19 11:41:43 WARN: Failed to load embedded library from /tmp/orly-libsecp256k1/libsecp256k1.so: Error relocating /tmp/orly-libsecp256k1/libsecp256k1.so: __fprintf_chk: symbol not found, falling back to system paths +2025/11/19 11:41:43 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2 +Events saved: 50000/50000 (100.0%), errors: 0 +Duration: 2.785536478s +Events/sec: 17949.86 +Avg latency: 1.089014ms +P90 latency: 1.55218ms +P95 latency: 1.801326ms +P99 latency: 2.589579ms +Bottom 10% Avg latency: 552.633µs +Wiping database between tests... +RunBurstPatternTest (Badger).. + +=== Burst Pattern Test === +Burst completed: 5000 events in 317.450827ms +Burst completed: 5000 events in 281.729068ms +Burst completed: 5000 events in 296.735543ms +Burst completed: 5000 events in 299.018917ms +Burst completed: 5000 events in 266.294256ms +Burst completed: 5000 events in 298.28913ms +Burst completed: 5000 events in 342.863483ms +Burst completed: 5000 events in 278.70182ms +Burst completed: 5000 events in 290.619707ms +Burst completed: 5000 events in 266.326046ms +Burst test completed: 50000 events in 7.944358646s, errors: 0 +Events/sec: 6293.77 +Wiping database between tests... +RunMixedReadWriteTest (Badger).. + +=== Mixed Read/Write Test === +Generating 1000 unique synthetic events (minimum 300 bytes each)... +Generated 1000 events: + Average content size: 312 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database for read tests... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Mixed test completed: 25000 writes, 25000 reads in 24.356991604s +Combined ops/sec: 2052.80 +Wiping database between tests... +RunQueryTest (Badger).. + +=== Query Test === +Generating 10000 unique synthetic events (minimum 300 bytes each)... +Generated 10000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 10000 events for query tests... +Query test completed: 437548 queries in 1m0.00346203s +Queries/sec: 7292.05 +Avg query latency: 1.484983ms +P95 query latency: 5.829694ms +P99 query latency: 9.624546ms +Wiping database between tests... +RunConcurrentQueryStoreTest (Badger).. + +=== Concurrent Query/Store Test === +Generating 5000 unique synthetic events (minimum 300 bytes each)... +Generated 5000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 5000 events for concurrent query/store test... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Concurrent test completed: 328438 operations (278438 queries, 50000 writes) in 1m0.00427172s +Operations/sec: 5473.58 +Avg latency: 1.350439ms +Avg query latency: 1.327273ms +Avg write latency: 1.479447ms +P95 latency: 3.495151ms +P99 latency: 5.959117ms + +=== Badger benchmark completed === + + +================================================================================ +BENCHMARK REPORT +================================================================================ + +Test: Peak Throughput +Duration: 2.785536478s +Total Events: 50000 +Events/sec: 17949.86 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 155 MB +Avg Latency: 1.089014ms +P90 Latency: 1.55218ms +P95 Latency: 1.801326ms +P99 Latency: 2.589579ms +Bottom 10% Avg Latency: 552.633µs +---------------------------------------- + +Test: Burst Pattern +Duration: 7.944358646s +Total Events: 50000 +Events/sec: 6293.77 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 364 MB +Avg Latency: 749.292µs +P90 Latency: 1.280402ms +P95 Latency: 1.544064ms +P99 Latency: 2.361203ms +Bottom 10% Avg Latency: 266.475µs +---------------------------------------- + +Test: Mixed Read/Write +Duration: 24.356991604s +Total Events: 50000 +Events/sec: 2052.80 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 181 MB +Avg Latency: 348.627µs +P90 Latency: 716.516µs +P95 Latency: 797.32µs +P99 Latency: 974.468µs +Bottom 10% Avg Latency: 896.226µs +---------------------------------------- + +Test: Query Performance +Duration: 1m0.00346203s +Total Events: 437548 +Events/sec: 7292.05 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 130 MB +Avg Latency: 1.484983ms +P90 Latency: 4.34872ms +P95 Latency: 5.829694ms +P99 Latency: 9.624546ms +Bottom 10% Avg Latency: 6.619683ms +---------------------------------------- + +Test: Concurrent Query/Store +Duration: 1m0.00427172s +Total Events: 328438 +Events/sec: 5473.58 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 119 MB +Avg Latency: 1.350439ms +P90 Latency: 2.752967ms +P95 Latency: 3.495151ms +P99 Latency: 5.959117ms +Bottom 10% Avg Latency: 4.092929ms +---------------------------------------- + +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 + +RELAY_NAME: next-orly-badger +RELAY_URL: ws://next-orly-badger:8080 +TEST_TIMESTAMP: 2025-11-19T11:45:00+00:00 +BENCHMARK_CONFIG: + Events: 50000 + Workers: 24 + Duration: 60s diff --git a/cmd/benchmark/reports/run_20251119_114143/next-orly-dgraph_results.txt b/cmd/benchmark/reports/run_20251119_114143/next-orly-dgraph_results.txt new file mode 100644 index 0000000..d3536f2 --- /dev/null +++ b/cmd/benchmark/reports/run_20251119_114143/next-orly-dgraph_results.txt @@ -0,0 +1,194 @@ +Starting Nostr Relay Benchmark (Badger Backend) +Data Directory: /tmp/benchmark_next-orly-dgraph_8 +Events: 50000, Workers: 24, Duration: 1m0s +1763552705731078ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66 +1763552705731138ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73 +1763552705731158ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80 +1763552705731164ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287 +1763552705731174ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332 +1763552705731188ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87 +1763552705731192ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340 +1763552705731202ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429 +1763552705731208ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:538 + +╔════════════════════════════════════════════════════════╗ +║ BADGER BACKEND BENCHMARK SUITE ║ +╚════════════════════════════════════════════════════════╝ + +=== Starting Badger benchmark === +RunPeakThroughputTest (Badger).. + +=== Peak Throughput Test === +2025/11/19 11:45:05 WARN: Failed to load embedded library from /tmp/orly-libsecp256k1/libsecp256k1.so: Error relocating /tmp/orly-libsecp256k1/libsecp256k1.so: __fprintf_chk: symbol not found, falling back to system paths +2025/11/19 11:45:05 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2 +Events saved: 50000/50000 (100.0%), errors: 0 +Duration: 2.836527264s +Events/sec: 17627.19 +Avg latency: 1.103766ms +P90 latency: 1.593556ms +P95 latency: 1.895983ms +P99 latency: 3.010115ms +Bottom 10% Avg latency: 537.227µs +Wiping database between tests... +RunBurstPatternTest (Badger).. + +=== Burst Pattern Test === +Burst completed: 5000 events in 280.061027ms +Burst completed: 5000 events in 300.335244ms +Burst completed: 5000 events in 275.258322ms +Burst completed: 5000 events in 313.843188ms +Burst completed: 5000 events in 312.900441ms +Burst completed: 5000 events in 328.998411ms +Burst completed: 5000 events in 351.267097ms +Burst completed: 5000 events in 301.59792ms +Burst completed: 5000 events in 258.613699ms +Burst completed: 5000 events in 283.438618ms +Burst test completed: 50000 events in 8.011527851s, errors: 0 +Events/sec: 6241.01 +Wiping database between tests... +RunMixedReadWriteTest (Badger).. + +=== Mixed Read/Write Test === +Generating 1000 unique synthetic events (minimum 300 bytes each)... +Generated 1000 events: + Average content size: 312 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database for read tests... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Mixed test completed: 25000 writes, 25000 reads in 24.458311788s +Combined ops/sec: 2044.29 +Wiping database between tests... +RunQueryTest (Badger).. + +=== Query Test === +Generating 10000 unique synthetic events (minimum 300 bytes each)... +Generated 10000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 10000 events for query tests... +Query test completed: 419645 queries in 1m0.004626673s +Queries/sec: 6993.54 +Avg query latency: 1.565119ms +P95 query latency: 6.288941ms +P99 query latency: 10.508808ms +Wiping database between tests... +RunConcurrentQueryStoreTest (Badger).. + +=== Concurrent Query/Store Test === +Generating 5000 unique synthetic events (minimum 300 bytes each)... +Generated 5000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 5000 events for concurrent query/store test... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Concurrent test completed: 332245 operations (282245 queries, 50000 writes) in 1m0.003126907s +Operations/sec: 5537.13 +Avg latency: 1.357488ms +Avg query latency: 1.299954ms +Avg write latency: 1.682258ms +P95 latency: 3.431084ms +P99 latency: 6.844626ms + +=== Badger benchmark completed === + + +================================================================================ +BENCHMARK REPORT +================================================================================ + +Test: Peak Throughput +Duration: 2.836527264s +Total Events: 50000 +Events/sec: 17627.19 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 155 MB +Avg Latency: 1.103766ms +P90 Latency: 1.593556ms +P95 Latency: 1.895983ms +P99 Latency: 3.010115ms +Bottom 10% Avg Latency: 537.227µs +---------------------------------------- + +Test: Burst Pattern +Duration: 8.011527851s +Total Events: 50000 +Events/sec: 6241.01 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 331 MB +Avg Latency: 973.956µs +P90 Latency: 1.60055ms +P95 Latency: 1.938364ms +P99 Latency: 3.035794ms +Bottom 10% Avg Latency: 318.193µs +---------------------------------------- + +Test: Mixed Read/Write +Duration: 24.458311788s +Total Events: 50000 +Events/sec: 2044.29 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 175 MB +Avg Latency: 362.034µs +P90 Latency: 747.544µs +P95 Latency: 839.77µs +P99 Latency: 1.058476ms +Bottom 10% Avg Latency: 953.865µs +---------------------------------------- + +Test: Query Performance +Duration: 1m0.004626673s +Total Events: 419645 +Events/sec: 6993.54 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 120 MB +Avg Latency: 1.565119ms +P90 Latency: 4.643114ms +P95 Latency: 6.288941ms +P99 Latency: 10.508808ms +Bottom 10% Avg Latency: 7.149269ms +---------------------------------------- + +Test: Concurrent Query/Store +Duration: 1m0.003126907s +Total Events: 332245 +Events/sec: 5537.13 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 136 MB +Avg Latency: 1.357488ms +P90 Latency: 2.687117ms +P95 Latency: 3.431084ms +P99 Latency: 6.844626ms +Bottom 10% Avg Latency: 4.340237ms +---------------------------------------- + +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 + +RELAY_NAME: next-orly-dgraph +RELAY_URL: ws://next-orly-dgraph:8080 +TEST_TIMESTAMP: 2025-11-19T11:48:23+00:00 +BENCHMARK_CONFIG: + Events: 50000 + Workers: 24 + Duration: 60s diff --git a/cmd/benchmark/reports/run_20251119_114143/next-orly-neo4j_results.txt b/cmd/benchmark/reports/run_20251119_114143/next-orly-neo4j_results.txt new file mode 100644 index 0000000..77b3fe6 --- /dev/null +++ b/cmd/benchmark/reports/run_20251119_114143/next-orly-neo4j_results.txt @@ -0,0 +1,194 @@ +Starting Nostr Relay Benchmark (Badger Backend) +Data Directory: /tmp/benchmark_next-orly-neo4j_8 +Events: 50000, Workers: 24, Duration: 1m0s +1763552908109792ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66 +1763552908109886ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73 +1763552908109908ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80 +1763552908109914ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287 +1763552908109924ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332 +1763552908109937ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87 +1763552908109942ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340 +1763552908109955ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429 +1763552908109961ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:538 + +╔════════════════════════════════════════════════════════╗ +║ BADGER BACKEND BENCHMARK SUITE ║ +╚════════════════════════════════════════════════════════╝ + +=== Starting Badger benchmark === +RunPeakThroughputTest (Badger).. + +=== Peak Throughput Test === +2025/11/19 11:48:28 WARN: Failed to load embedded library from /tmp/orly-libsecp256k1/libsecp256k1.so: Error relocating /tmp/orly-libsecp256k1/libsecp256k1.so: __fprintf_chk: symbol not found, falling back to system paths +2025/11/19 11:48:28 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2 +Events saved: 50000/50000 (100.0%), errors: 0 +Duration: 3.218235317s +Events/sec: 15536.46 +Avg latency: 1.414281ms +P90 latency: 2.076394ms +P95 latency: 2.486204ms +P99 latency: 3.930355ms +Bottom 10% Avg latency: 704.384µs +Wiping database between tests... +RunBurstPatternTest (Badger).. + +=== Burst Pattern Test === +Burst completed: 5000 events in 301.938212ms +Burst completed: 5000 events in 313.031584ms +Burst completed: 5000 events in 265.709133ms +Burst completed: 5000 events in 307.375893ms +Burst completed: 5000 events in 266.741467ms +Burst completed: 5000 events in 311.20987ms +Burst completed: 5000 events in 317.993736ms +Burst completed: 5000 events in 310.504816ms +Burst completed: 5000 events in 274.515075ms +Burst completed: 5000 events in 300.252051ms +Burst test completed: 50000 events in 7.975519923s, errors: 0 +Events/sec: 6269.18 +Wiping database between tests... +RunMixedReadWriteTest (Badger).. + +=== Mixed Read/Write Test === +Generating 1000 unique synthetic events (minimum 300 bytes each)... +Generated 1000 events: + Average content size: 312 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database for read tests... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Mixed test completed: 25000 writes, 25000 reads in 24.405822499s +Combined ops/sec: 2048.69 +Wiping database between tests... +RunQueryTest (Badger).. + +=== Query Test === +Generating 10000 unique synthetic events (minimum 300 bytes each)... +Generated 10000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 10000 events for query tests... +Query test completed: 415410 queries in 1m0.004397847s +Queries/sec: 6922.99 +Avg query latency: 1.588134ms +P95 query latency: 6.413781ms +P99 query latency: 10.205668ms +Wiping database between tests... +RunConcurrentQueryStoreTest (Badger).. + +=== Concurrent Query/Store Test === +Generating 5000 unique synthetic events (minimum 300 bytes each)... +Generated 5000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 5000 events for concurrent query/store test... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Concurrent test completed: 330584 operations (280584 queries, 50000 writes) in 1m0.003241067s +Operations/sec: 5509.44 +Avg latency: 1.343539ms +Avg query latency: 1.315494ms +Avg write latency: 1.500921ms +P95 latency: 3.442423ms +P99 latency: 5.829737ms + +=== Badger benchmark completed === + + +================================================================================ +BENCHMARK REPORT +================================================================================ + +Test: Peak Throughput +Duration: 3.218235317s +Total Events: 50000 +Events/sec: 15536.46 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 161 MB +Avg Latency: 1.414281ms +P90 Latency: 2.076394ms +P95 Latency: 2.486204ms +P99 Latency: 3.930355ms +Bottom 10% Avg Latency: 704.384µs +---------------------------------------- + +Test: Burst Pattern +Duration: 7.975519923s +Total Events: 50000 +Events/sec: 6269.18 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 233 MB +Avg Latency: 919.794µs +P90 Latency: 1.535845ms +P95 Latency: 1.842478ms +P99 Latency: 2.842222ms +Bottom 10% Avg Latency: 284.854µs +---------------------------------------- + +Test: Mixed Read/Write +Duration: 24.405822499s +Total Events: 50000 +Events/sec: 2048.69 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 158 MB +Avg Latency: 356.992µs +P90 Latency: 736.282µs +P95 Latency: 828.598µs +P99 Latency: 1.054387ms +Bottom 10% Avg Latency: 927.325µs +---------------------------------------- + +Test: Query Performance +Duration: 1m0.004397847s +Total Events: 415410 +Events/sec: 6922.99 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 128 MB +Avg Latency: 1.588134ms +P90 Latency: 4.790039ms +P95 Latency: 6.413781ms +P99 Latency: 10.205668ms +Bottom 10% Avg Latency: 7.154636ms +---------------------------------------- + +Test: Concurrent Query/Store +Duration: 1m0.003241067s +Total Events: 330584 +Events/sec: 5509.44 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 120 MB +Avg Latency: 1.343539ms +P90 Latency: 2.726991ms +P95 Latency: 3.442423ms +P99 Latency: 5.829737ms +Bottom 10% Avg Latency: 4.02073ms +---------------------------------------- + +Report saved to: /tmp/benchmark_next-orly-neo4j_8/benchmark_report.txt +AsciiDoc report saved to: /tmp/benchmark_next-orly-neo4j_8/benchmark_report.adoc + +RELAY_NAME: next-orly-neo4j +RELAY_URL: ws://next-orly-neo4j:8080 +TEST_TIMESTAMP: 2025-11-19T11:51:45+00:00 +BENCHMARK_CONFIG: + Events: 50000 + Workers: 24 + Duration: 60s diff --git a/cmd/benchmark/reports/run_20251119_114143/nostr-rs-relay_results.txt b/cmd/benchmark/reports/run_20251119_114143/nostr-rs-relay_results.txt new file mode 100644 index 0000000..f469560 --- /dev/null +++ b/cmd/benchmark/reports/run_20251119_114143/nostr-rs-relay_results.txt @@ -0,0 +1,194 @@ +Starting Nostr Relay Benchmark (Badger Backend) +Data Directory: /tmp/benchmark_nostr-rs-relay_8 +Events: 50000, Workers: 24, Duration: 1m0s +1763553920905673ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66 +1763553920905751ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73 +1763553920905773ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80 +1763553920905780ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287 +1763553920905790ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332 +1763553920905809ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87 +1763553920905815ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340 +1763553920905826ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429 +1763553920905831ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:538 + +╔════════════════════════════════════════════════════════╗ +║ BADGER BACKEND BENCHMARK SUITE ║ +╚════════════════════════════════════════════════════════╝ + +=== Starting Badger benchmark === +RunPeakThroughputTest (Badger).. + +=== Peak Throughput Test === +2025/11/19 12:05:20 WARN: Failed to load embedded library from /tmp/orly-libsecp256k1/libsecp256k1.so: Error relocating /tmp/orly-libsecp256k1/libsecp256k1.so: __fprintf_chk: symbol not found, falling back to system paths +2025/11/19 12:05:20 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2 +Events saved: 50000/50000 (100.0%), errors: 0 +Duration: 2.982518845s +Events/sec: 16764.35 +Avg latency: 1.245012ms +P90 latency: 1.807629ms +P95 latency: 2.151312ms +P99 latency: 3.240824ms +Bottom 10% Avg latency: 614.335µs +Wiping database between tests... +RunBurstPatternTest (Badger).. + +=== Burst Pattern Test === +Burst completed: 5000 events in 281.003362ms +Burst completed: 5000 events in 309.061248ms +Burst completed: 5000 events in 287.188282ms +Burst completed: 5000 events in 312.168826ms +Burst completed: 5000 events in 265.066224ms +Burst completed: 5000 events in 294.341689ms +Burst completed: 5000 events in 347.422564ms +Burst completed: 5000 events in 279.885181ms +Burst completed: 5000 events in 261.874189ms +Burst completed: 5000 events in 289.890466ms +Burst test completed: 50000 events in 7.935611226s, errors: 0 +Events/sec: 6300.71 +Wiping database between tests... +RunMixedReadWriteTest (Badger).. + +=== Mixed Read/Write Test === +Generating 1000 unique synthetic events (minimum 300 bytes each)... +Generated 1000 events: + Average content size: 312 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database for read tests... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Mixed test completed: 25000 writes, 25000 reads in 24.4135272s +Combined ops/sec: 2048.04 +Wiping database between tests... +RunQueryTest (Badger).. + +=== Query Test === +Generating 10000 unique synthetic events (minimum 300 bytes each)... +Generated 10000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 10000 events for query tests... +Query test completed: 430130 queries in 1m0.004366885s +Queries/sec: 7168.31 +Avg query latency: 1.528235ms +P95 query latency: 6.050953ms +P99 query latency: 9.954498ms +Wiping database between tests... +RunConcurrentQueryStoreTest (Badger).. + +=== Concurrent Query/Store Test === +Generating 5000 unique synthetic events (minimum 300 bytes each)... +Generated 5000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 5000 events for concurrent query/store test... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Concurrent test completed: 333734 operations (283734 queries, 50000 writes) in 1m0.004269794s +Operations/sec: 5561.84 +Avg latency: 1.317015ms +Avg query latency: 1.295184ms +Avg write latency: 1.440899ms +P95 latency: 3.369234ms +P99 latency: 5.820636ms + +=== Badger benchmark completed === + + +================================================================================ +BENCHMARK REPORT +================================================================================ + +Test: Peak Throughput +Duration: 2.982518845s +Total Events: 50000 +Events/sec: 16764.35 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 129 MB +Avg Latency: 1.245012ms +P90 Latency: 1.807629ms +P95 Latency: 2.151312ms +P99 Latency: 3.240824ms +Bottom 10% Avg Latency: 614.335µs +---------------------------------------- + +Test: Burst Pattern +Duration: 7.935611226s +Total Events: 50000 +Events/sec: 6300.71 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 289 MB +Avg Latency: 869.47µs +P90 Latency: 1.41943ms +P95 Latency: 1.707251ms +P99 Latency: 2.634998ms +Bottom 10% Avg Latency: 297.293µs +---------------------------------------- + +Test: Mixed Read/Write +Duration: 24.4135272s +Total Events: 50000 +Events/sec: 2048.04 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 129 MB +Avg Latency: 348.336µs +P90 Latency: 725.399µs +P95 Latency: 816.334µs +P99 Latency: 1.048158ms +Bottom 10% Avg Latency: 906.961µs +---------------------------------------- + +Test: Query Performance +Duration: 1m0.004366885s +Total Events: 430130 +Events/sec: 7168.31 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 109 MB +Avg Latency: 1.528235ms +P90 Latency: 4.478876ms +P95 Latency: 6.050953ms +P99 Latency: 9.954498ms +Bottom 10% Avg Latency: 6.853109ms +---------------------------------------- + +Test: Concurrent Query/Store +Duration: 1m0.004269794s +Total Events: 333734 +Events/sec: 5561.84 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 110 MB +Avg Latency: 1.317015ms +P90 Latency: 2.675799ms +P95 Latency: 3.369234ms +P99 Latency: 5.820636ms +Bottom 10% Avg Latency: 3.995899ms +---------------------------------------- + +Report saved to: /tmp/benchmark_nostr-rs-relay_8/benchmark_report.txt +AsciiDoc report saved to: /tmp/benchmark_nostr-rs-relay_8/benchmark_report.adoc + +RELAY_NAME: nostr-rs-relay +RELAY_URL: ws://nostr-rs-relay:8080 +TEST_TIMESTAMP: 2025-11-19T12:08:38+00:00 +BENCHMARK_CONFIG: + Events: 50000 + Workers: 24 + Duration: 60s diff --git a/cmd/benchmark/reports/run_20251119_114143/relayer-basic_results.txt b/cmd/benchmark/reports/run_20251119_114143/relayer-basic_results.txt new file mode 100644 index 0000000..38d2b6f --- /dev/null +++ b/cmd/benchmark/reports/run_20251119_114143/relayer-basic_results.txt @@ -0,0 +1,194 @@ +Starting Nostr Relay Benchmark (Badger Backend) +Data Directory: /tmp/benchmark_relayer-basic_8 +Events: 50000, Workers: 24, Duration: 1m0s +1763553515697722ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66 +1763553515697789ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73 +1763553515697814ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80 +1763553515697821ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287 +1763553515697832ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332 +1763553515697850ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87 +1763553515697856ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340 +1763553515697872ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429 +1763553515697879ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:538 + +╔════════════════════════════════════════════════════════╗ +║ BADGER BACKEND BENCHMARK SUITE ║ +╚════════════════════════════════════════════════════════╝ + +=== Starting Badger benchmark === +RunPeakThroughputTest (Badger).. + +=== Peak Throughput Test === +2025/11/19 11:58:35 WARN: Failed to load embedded library from /tmp/orly-libsecp256k1/libsecp256k1.so: Error relocating /tmp/orly-libsecp256k1/libsecp256k1.so: __fprintf_chk: symbol not found, falling back to system paths +2025/11/19 11:58:35 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2 +Events saved: 50000/50000 (100.0%), errors: 0 +Duration: 2.803257666s +Events/sec: 17836.39 +Avg latency: 1.081434ms +P90 latency: 1.542545ms +P95 latency: 1.853627ms +P99 latency: 3.03258ms +Bottom 10% Avg latency: 525.619µs +Wiping database between tests... +RunBurstPatternTest (Badger).. + +=== Burst Pattern Test === +Burst completed: 5000 events in 285.768096ms +Burst completed: 5000 events in 295.661708ms +Burst completed: 5000 events in 313.067191ms +Burst completed: 5000 events in 295.800371ms +Burst completed: 5000 events in 282.901081ms +Burst completed: 5000 events in 322.19214ms +Burst completed: 5000 events in 332.397114ms +Burst completed: 5000 events in 272.623827ms +Burst completed: 5000 events in 255.567207ms +Burst completed: 5000 events in 311.027979ms +Burst test completed: 50000 events in 7.973444489s, errors: 0 +Events/sec: 6270.82 +Wiping database between tests... +RunMixedReadWriteTest (Badger).. + +=== Mixed Read/Write Test === +Generating 1000 unique synthetic events (minimum 300 bytes each)... +Generated 1000 events: + Average content size: 312 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database for read tests... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Mixed test completed: 25000 writes, 25000 reads in 24.504151701s +Combined ops/sec: 2040.47 +Wiping database between tests... +RunQueryTest (Badger).. + +=== Query Test === +Generating 10000 unique synthetic events (minimum 300 bytes each)... +Generated 10000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 10000 events for query tests... +Query test completed: 410656 queries in 1m0.007248632s +Queries/sec: 6843.44 +Avg query latency: 1.610981ms +P95 query latency: 6.475108ms +P99 query latency: 10.557655ms +Wiping database between tests... +RunConcurrentQueryStoreTest (Badger).. + +=== Concurrent Query/Store Test === +Generating 5000 unique synthetic events (minimum 300 bytes each)... +Generated 5000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 5000 events for concurrent query/store test... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Concurrent test completed: 329875 operations (279875 queries, 50000 writes) in 1m0.002939993s +Operations/sec: 5497.65 +Avg latency: 1.347653ms +Avg query latency: 1.319379ms +Avg write latency: 1.505918ms +P95 latency: 3.479869ms +P99 latency: 5.990926ms + +=== Badger benchmark completed === + + +================================================================================ +BENCHMARK REPORT +================================================================================ + +Test: Peak Throughput +Duration: 2.803257666s +Total Events: 50000 +Events/sec: 17836.39 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 132 MB +Avg Latency: 1.081434ms +P90 Latency: 1.542545ms +P95 Latency: 1.853627ms +P99 Latency: 3.03258ms +Bottom 10% Avg Latency: 525.619µs +---------------------------------------- + +Test: Burst Pattern +Duration: 7.973444489s +Total Events: 50000 +Events/sec: 6270.82 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 239 MB +Avg Latency: 951.65µs +P90 Latency: 1.501036ms +P95 Latency: 1.779976ms +P99 Latency: 2.806119ms +Bottom 10% Avg Latency: 307.676µs +---------------------------------------- + +Test: Mixed Read/Write +Duration: 24.504151701s +Total Events: 50000 +Events/sec: 2040.47 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 159 MB +Avg Latency: 358.608µs +P90 Latency: 741.841µs +P95 Latency: 831.883µs +P99 Latency: 1.05125ms +Bottom 10% Avg Latency: 913.888µs +---------------------------------------- + +Test: Query Performance +Duration: 1m0.007248632s +Total Events: 410656 +Events/sec: 6843.44 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 132 MB +Avg Latency: 1.610981ms +P90 Latency: 4.794751ms +P95 Latency: 6.475108ms +P99 Latency: 10.557655ms +Bottom 10% Avg Latency: 7.3137ms +---------------------------------------- + +Test: Concurrent Query/Store +Duration: 1m0.002939993s +Total Events: 329875 +Events/sec: 5497.65 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 102 MB +Avg Latency: 1.347653ms +P90 Latency: 2.710576ms +P95 Latency: 3.479869ms +P99 Latency: 5.990926ms +Bottom 10% Avg Latency: 4.105794ms +---------------------------------------- + +Report saved to: /tmp/benchmark_relayer-basic_8/benchmark_report.txt +AsciiDoc report saved to: /tmp/benchmark_relayer-basic_8/benchmark_report.adoc + +RELAY_NAME: relayer-basic +RELAY_URL: ws://relayer-basic:7447 +TEST_TIMESTAMP: 2025-11-19T12:01:52+00:00 +BENCHMARK_CONFIG: + Events: 50000 + Workers: 24 + Duration: 60s diff --git a/cmd/benchmark/reports/run_20251119_114143/strfry_results.txt b/cmd/benchmark/reports/run_20251119_114143/strfry_results.txt new file mode 100644 index 0000000..d608bcc --- /dev/null +++ b/cmd/benchmark/reports/run_20251119_114143/strfry_results.txt @@ -0,0 +1,194 @@ +Starting Nostr Relay Benchmark (Badger Backend) +Data Directory: /tmp/benchmark_strfry_8 +Events: 50000, Workers: 24, Duration: 1m0s +1763553718040055ℹ️ migrating to version 1... /build/pkg/database/migrations.go:66 +1763553718040163ℹ️ migrating to version 2... /build/pkg/database/migrations.go:73 +1763553718040192ℹ️ migrating to version 3... /build/pkg/database/migrations.go:80 +1763553718040200ℹ️ cleaning up ephemeral events (kinds 20000-29999)... /build/pkg/database/migrations.go:287 +1763553718040213ℹ️ cleaned up 0 ephemeral events from database /build/pkg/database/migrations.go:332 +1763553718040231ℹ️ migrating to version 4... /build/pkg/database/migrations.go:87 +1763553718040237ℹ️ converting events to optimized inline storage (Reiser4 optimization)... /build/pkg/database/migrations.go:340 +1763553718040250ℹ️ found 0 events to convert (0 regular, 0 replaceable, 0 addressable) /build/pkg/database/migrations.go:429 +1763553718040257ℹ️ migration complete: converted 0 events to optimized inline storage, deleted 0 old keys /build/pkg/database/migrations.go:538 + +╔════════════════════════════════════════════════════════╗ +║ BADGER BACKEND BENCHMARK SUITE ║ +╚════════════════════════════════════════════════════════╝ + +=== Starting Badger benchmark === +RunPeakThroughputTest (Badger).. + +=== Peak Throughput Test === +2025/11/19 12:01:58 WARN: Failed to load embedded library from /tmp/orly-libsecp256k1/libsecp256k1.so: Error relocating /tmp/orly-libsecp256k1/libsecp256k1.so: __fprintf_chk: symbol not found, falling back to system paths +2025/11/19 12:01:58 INFO: Successfully loaded libsecp256k1 v5.0.0 from system path: libsecp256k1.so.2 +Events saved: 50000/50000 (100.0%), errors: 0 +Duration: 3.035812013s +Events/sec: 16470.06 +Avg latency: 1.261656ms +P90 latency: 1.86043ms +P95 latency: 2.241835ms +P99 latency: 3.791012ms +Bottom 10% Avg latency: 566.551µs +Wiping database between tests... +RunBurstPatternTest (Badger).. + +=== Burst Pattern Test === +Burst completed: 5000 events in 309.527802ms +Burst completed: 5000 events in 299.690349ms +Burst completed: 5000 events in 321.057535ms +Burst completed: 5000 events in 323.104548ms +Burst completed: 5000 events in 363.925348ms +Burst completed: 5000 events in 371.373375ms +Burst completed: 5000 events in 349.908414ms +Burst completed: 5000 events in 323.642941ms +Burst completed: 5000 events in 326.073936ms +Burst completed: 5000 events in 332.367747ms +Burst test completed: 50000 events in 8.326455297s, errors: 0 +Events/sec: 6004.96 +Wiping database between tests... +RunMixedReadWriteTest (Badger).. + +=== Mixed Read/Write Test === +Generating 1000 unique synthetic events (minimum 300 bytes each)... +Generated 1000 events: + Average content size: 312 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database for read tests... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Mixed test completed: 25000 writes, 25000 reads in 24.489409377s +Combined ops/sec: 2041.70 +Wiping database between tests... +RunQueryTest (Badger).. + +=== Query Test === +Generating 10000 unique synthetic events (minimum 300 bytes each)... +Generated 10000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 10000 events for query tests... +Query test completed: 415410 queries in 1m0.006077117s +Queries/sec: 6922.80 +Avg query latency: 1.587664ms +P95 query latency: 6.417337ms +P99 query latency: 10.569454ms +Wiping database between tests... +RunConcurrentQueryStoreTest (Badger).. + +=== Concurrent Query/Store Test === +Generating 5000 unique synthetic events (minimum 300 bytes each)... +Generated 5000 events: + Average content size: 313 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Pre-populating database with 5000 events for concurrent query/store test... +Generating 50000 unique synthetic events (minimum 300 bytes each)... +Generated 50000 events: + Average content size: 314 bytes + All events are unique (incremental timestamps) + All events are properly signed + +Concurrent test completed: 335215 operations (285215 queries, 50000 writes) in 1m0.003669664s +Operations/sec: 5586.57 +Avg latency: 1.33393ms +Avg query latency: 1.282711ms +Avg write latency: 1.626098ms +P95 latency: 3.420507ms +P99 latency: 6.376008ms + +=== Badger benchmark completed === + + +================================================================================ +BENCHMARK REPORT +================================================================================ + +Test: Peak Throughput +Duration: 3.035812013s +Total Events: 50000 +Events/sec: 16470.06 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 147 MB +Avg Latency: 1.261656ms +P90 Latency: 1.86043ms +P95 Latency: 2.241835ms +P99 Latency: 3.791012ms +Bottom 10% Avg Latency: 566.551µs +---------------------------------------- + +Test: Burst Pattern +Duration: 8.326455297s +Total Events: 50000 +Events/sec: 6004.96 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 292 MB +Avg Latency: 1.02418ms +P90 Latency: 1.878082ms +P95 Latency: 2.314062ms +P99 Latency: 3.784179ms +Bottom 10% Avg Latency: 299.97µs +---------------------------------------- + +Test: Mixed Read/Write +Duration: 24.489409377s +Total Events: 50000 +Events/sec: 2041.70 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 117 MB +Avg Latency: 358.856µs +P90 Latency: 734.307µs +P95 Latency: 821.493µs +P99 Latency: 1.037233ms +Bottom 10% Avg Latency: 941.286µs +---------------------------------------- + +Test: Query Performance +Duration: 1m0.006077117s +Total Events: 415410 +Events/sec: 6922.80 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 122 MB +Avg Latency: 1.587664ms +P90 Latency: 4.724046ms +P95 Latency: 6.417337ms +P99 Latency: 10.569454ms +Bottom 10% Avg Latency: 7.25924ms +---------------------------------------- + +Test: Concurrent Query/Store +Duration: 1m0.003669664s +Total Events: 335215 +Events/sec: 5586.57 +Success Rate: 100.0% +Concurrent Workers: 24 +Memory Used: 123 MB +Avg Latency: 1.33393ms +P90 Latency: 2.669918ms +P95 Latency: 3.420507ms +P99 Latency: 6.376008ms +Bottom 10% Avg Latency: 4.184519ms +---------------------------------------- + +Report saved to: /tmp/benchmark_strfry_8/benchmark_report.txt +AsciiDoc report saved to: /tmp/benchmark_strfry_8/benchmark_report.adoc + +RELAY_NAME: strfry +RELAY_URL: ws://strfry:8080 +TEST_TIMESTAMP: 2025-11-19T12:05:15+00:00 +BENCHMARK_CONFIG: + Events: 50000 + Workers: 24 + Duration: 60s