diff --git a/README.md b/README.md index 1091359..a44f7b0 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,10 @@ A research tool used to benchmark the Wildcat storage engine. go build -o wildcat_bench main.go # Run default benchmarks (recommended first run) -./wildcat_bench +./bench # Run specific benchmarks -./wildcat_bench -benchmarks="fillseq,readseq,readrandom" +./bench -benchmarks="fillseq,readrandom" # Run with custom parameters ./wildcat_bench -num=50000 -threads=8 -key_size=32 -value_size=1024 @@ -97,510 +97,3 @@ go build -o wildcat_bench main.go -seed=1234567890 # Random seed for reproducible results -cleanup=true # Cleanup database after completion ``` - -## Example Output -```bash - -W) ww I)iiii L) D)dddd C)ccc A)aa T)tttttt -W) ww I) L) D) dd C) cc A) aa T) -W) ww ww I) L) D) dd C) A) aa T) -W) ww ww I) L) D) dd C) A)aaaaaa T) -W) ww ww I) L) D) dd C) cc A) aa T) -W)ww www I)iiii L)llllll D)ddddd C)ccc A) aa T) -Benchmark Tool - -Configuration -========================= -Database Path: /tmp/wildcat_bench -Write Buffer Size: 64 MB -Sync Option: none -Levels: 7 -Bloom Filter: true -Operations: 10000 -Key Size: 16 bytes -Value Size: 100 bytes -Threads: 16 -Batch Size: 1 -Benchmarks: fillseq, fillprefixed, readseq, readrandom, iterseq, iterrandom, iterprefix, concurrent_writers, high_contention_writes, batch_concurrent_writes -Key Distribution: sequential - -Running benchmark: fillseq -Database Stats: -┌──────────────────────────────────────────────────┐ -│ Wildcat DB Stats and Configuration │ -├──────────────────────────────────────────────────┤ -│ Write Buffer Size : 67108864 │ -│ Sync Option : 0 │ -│ Level Count : 7 │ -│ Bloom Filter Enabled : false │ -│ Max Compaction Concurrency : 4 │ -│ Compaction Cooldown : 5s │ -│ Compaction Batch Size : 8 │ -│ Compaction Size Ratio : 1.1 │ -│ Compaction Threshold : 8 │ -│ Score Size Weight : 0.8 │ -│ Score Count Weight : 0.2 │ -│ Flusher Interval : 1ms │ -│ Compactor Interval : 250ms │ -│ Bloom FPR : 0.01 │ -│ WAL Retry : 10 │ -│ WAL Backoff : 128µs │ -│ SSTable B-Tree Order : 10 │ -│ LRU Size : 1024 │ -│ LRU Evict Ratio : 0.2 │ -│ LRU Access Weight : 0.8 │ -│ File Version : 2 │ -│ Magic Number : 1464421444 │ -│ Directory : /tmp/wildcat_bench/ │ -├──────────────────────────────────────────────────┤ -│ ID Generator State │ -├──────────────────────────────────────────────────┤ -│ Last SST ID : 0 │ -│ Last WAL ID : 1 │ -├──────────────────────────────────────────────────┤ -│ Runtime Statistics │ -├──────────────────────────────────────────────────┤ -│ Active Memtable Size : 1160000 │ -│ Active Memtable Entries : 10000 │ -│ Active Transactions : 0 │ -│ WAL Files : 0 │ -│ Total SSTables : 0 │ -│ Total Entries : 10000 │ -└──────────────────────────────────────────────────┘ -Completed fillseq: 187359.11 ops/sec - -Running benchmark: fillprefixed -Database Stats: -┌──────────────────────────────────────────────────┐ -│ Wildcat DB Stats and Configuration │ -├──────────────────────────────────────────────────┤ -│ Write Buffer Size : 67108864 │ -│ Sync Option : 0 │ -│ Level Count : 7 │ -│ Bloom Filter Enabled : false │ -│ Max Compaction Concurrency : 4 │ -│ Compaction Cooldown : 5s │ -│ Compaction Batch Size : 8 │ -│ Compaction Size Ratio : 1.1 │ -│ Compaction Threshold : 8 │ -│ Score Size Weight : 0.8 │ -│ Score Count Weight : 0.2 │ -│ Flusher Interval : 1ms │ -│ Compactor Interval : 250ms │ -│ Bloom FPR : 0.01 │ -│ WAL Retry : 10 │ -│ WAL Backoff : 128µs │ -│ SSTable B-Tree Order : 10 │ -│ LRU Size : 1024 │ -│ LRU Evict Ratio : 0.2 │ -│ LRU Access Weight : 0.8 │ -│ File Version : 2 │ -│ Magic Number : 1464421444 │ -│ Directory : /tmp/wildcat_bench/ │ -├──────────────────────────────────────────────────┤ -│ ID Generator State │ -├──────────────────────────────────────────────────┤ -│ Last SST ID : 0 │ -│ Last WAL ID : 1 │ -├──────────────────────────────────────────────────┤ -│ Runtime Statistics │ -├──────────────────────────────────────────────────┤ -│ Active Memtable Size : 1160580 │ -│ Active Memtable Entries : 10005 │ -│ Active Transactions : 0 │ -│ WAL Files : 0 │ -│ Total SSTables : 0 │ -│ Total Entries : 10005 │ -└──────────────────────────────────────────────────┘ -Completed fillprefixed: 241326.17 ops/sec - -Running benchmark: readseq -Database Stats: -┌──────────────────────────────────────────────────┐ -│ Wildcat DB Stats and Configuration │ -├──────────────────────────────────────────────────┤ -│ Write Buffer Size : 67108864 │ -│ Sync Option : 0 │ -│ Level Count : 7 │ -│ Bloom Filter Enabled : false │ -│ Max Compaction Concurrency : 4 │ -│ Compaction Cooldown : 5s │ -│ Compaction Batch Size : 8 │ -│ Compaction Size Ratio : 1.1 │ -│ Compaction Threshold : 8 │ -│ Score Size Weight : 0.8 │ -│ Score Count Weight : 0.2 │ -│ Flusher Interval : 1ms │ -│ Compactor Interval : 250ms │ -│ Bloom FPR : 0.01 │ -│ WAL Retry : 10 │ -│ WAL Backoff : 128µs │ -│ SSTable B-Tree Order : 10 │ -│ LRU Size : 1024 │ -│ LRU Evict Ratio : 0.2 │ -│ LRU Access Weight : 0.8 │ -│ File Version : 2 │ -│ Magic Number : 1464421444 │ -│ Directory : /tmp/wildcat_bench/ │ -├──────────────────────────────────────────────────┤ -│ ID Generator State │ -├──────────────────────────────────────────────────┤ -│ Last SST ID : 0 │ -│ Last WAL ID : 1 │ -├──────────────────────────────────────────────────┤ -│ Runtime Statistics │ -├──────────────────────────────────────────────────┤ -│ Active Memtable Size : 1160580 │ -│ Active Memtable Entries : 10005 │ -│ Active Transactions : 0 │ -│ WAL Files : 0 │ -│ Total SSTables : 0 │ -│ Total Entries : 10005 │ -└──────────────────────────────────────────────────┘ -Completed readseq: 1820140.95 ops/sec - -Running benchmark: readrandom -Database Stats: -┌──────────────────────────────────────────────────┐ -│ Wildcat DB Stats and Configuration │ -├──────────────────────────────────────────────────┤ -│ Write Buffer Size : 67108864 │ -│ Sync Option : 0 │ -│ Level Count : 7 │ -│ Bloom Filter Enabled : false │ -│ Max Compaction Concurrency : 4 │ -│ Compaction Cooldown : 5s │ -│ Compaction Batch Size : 8 │ -│ Compaction Size Ratio : 1.1 │ -│ Compaction Threshold : 8 │ -│ Score Size Weight : 0.8 │ -│ Score Count Weight : 0.2 │ -│ Flusher Interval : 1ms │ -│ Compactor Interval : 250ms │ -│ Bloom FPR : 0.01 │ -│ WAL Retry : 10 │ -│ WAL Backoff : 128µs │ -│ SSTable B-Tree Order : 10 │ -│ LRU Size : 1024 │ -│ LRU Evict Ratio : 0.2 │ -│ LRU Access Weight : 0.8 │ -│ File Version : 2 │ -│ Magic Number : 1464421444 │ -│ Directory : /tmp/wildcat_bench/ │ -├──────────────────────────────────────────────────┤ -│ ID Generator State │ -├──────────────────────────────────────────────────┤ -│ Last SST ID : 0 │ -│ Last WAL ID : 1 │ -├──────────────────────────────────────────────────┤ -│ Runtime Statistics │ -├──────────────────────────────────────────────────┤ -│ Active Memtable Size : 1160580 │ -│ Active Memtable Entries : 10005 │ -│ Active Transactions : 0 │ -│ WAL Files : 0 │ -│ Total SSTables : 0 │ -│ Total Entries : 10005 │ -└──────────────────────────────────────────────────┘ -Completed readrandom: 2725031.76 ops/sec - -Running benchmark: iterseq -Database Stats: -┌──────────────────────────────────────────────────┐ -│ Wildcat DB Stats and Configuration │ -├──────────────────────────────────────────────────┤ -│ Write Buffer Size : 67108864 │ -│ Sync Option : 0 │ -│ Level Count : 7 │ -│ Bloom Filter Enabled : false │ -│ Max Compaction Concurrency : 4 │ -│ Compaction Cooldown : 5s │ -│ Compaction Batch Size : 8 │ -│ Compaction Size Ratio : 1.1 │ -│ Compaction Threshold : 8 │ -│ Score Size Weight : 0.8 │ -│ Score Count Weight : 0.2 │ -│ Flusher Interval : 1ms │ -│ Compactor Interval : 250ms │ -│ Bloom FPR : 0.01 │ -│ WAL Retry : 10 │ -│ WAL Backoff : 128µs │ -│ SSTable B-Tree Order : 10 │ -│ LRU Size : 1024 │ -│ LRU Evict Ratio : 0.2 │ -│ LRU Access Weight : 0.8 │ -│ File Version : 2 │ -│ Magic Number : 1464421444 │ -│ Directory : /tmp/wildcat_bench/ │ -├──────────────────────────────────────────────────┤ -│ ID Generator State │ -├──────────────────────────────────────────────────┤ -│ Last SST ID : 0 │ -│ Last WAL ID : 1 │ -├──────────────────────────────────────────────────┤ -│ Runtime Statistics │ -├──────────────────────────────────────────────────┤ -│ Active Memtable Size : 1160580 │ -│ Active Memtable Entries : 10005 │ -│ Active Transactions : 0 │ -│ WAL Files : 0 │ -│ Total SSTables : 0 │ -│ Total Entries : 10005 │ -└──────────────────────────────────────────────────┘ -Completed iterseq: 3098757.40 ops/sec - -Running benchmark: iterrandom -Database Stats: -┌──────────────────────────────────────────────────┐ -│ Wildcat DB Stats and Configuration │ -├──────────────────────────────────────────────────┤ -│ Write Buffer Size : 67108864 │ -│ Sync Option : 0 │ -│ Level Count : 7 │ -│ Bloom Filter Enabled : false │ -│ Max Compaction Concurrency : 4 │ -│ Compaction Cooldown : 5s │ -│ Compaction Batch Size : 8 │ -│ Compaction Size Ratio : 1.1 │ -│ Compaction Threshold : 8 │ -│ Score Size Weight : 0.8 │ -│ Score Count Weight : 0.2 │ -│ Flusher Interval : 1ms │ -│ Compactor Interval : 250ms │ -│ Bloom FPR : 0.01 │ -│ WAL Retry : 10 │ -│ WAL Backoff : 128µs │ -│ SSTable B-Tree Order : 10 │ -│ LRU Size : 1024 │ -│ LRU Evict Ratio : 0.2 │ -│ LRU Access Weight : 0.8 │ -│ File Version : 2 │ -│ Magic Number : 1464421444 │ -│ Directory : /tmp/wildcat_bench/ │ -├──────────────────────────────────────────────────┤ -│ ID Generator State │ -├──────────────────────────────────────────────────┤ -│ Last SST ID : 0 │ -│ Last WAL ID : 1 │ -├──────────────────────────────────────────────────┤ -│ Runtime Statistics │ -├──────────────────────────────────────────────────┤ -│ Active Memtable Size : 1160580 │ -│ Active Memtable Entries : 10005 │ -│ Active Transactions : 0 │ -│ WAL Files : 0 │ -│ Total SSTables : 0 │ -│ Total Entries : 10005 │ -└──────────────────────────────────────────────────┘ -Completed iterrandom: 72778.46 ops/sec - -Running benchmark: iterprefix -Database Stats: -┌──────────────────────────────────────────────────┐ -│ Wildcat DB Stats and Configuration │ -├──────────────────────────────────────────────────┤ -│ Write Buffer Size : 67108864 │ -│ Sync Option : 0 │ -│ Level Count : 7 │ -│ Bloom Filter Enabled : false │ -│ Max Compaction Concurrency : 4 │ -│ Compaction Cooldown : 5s │ -│ Compaction Batch Size : 8 │ -│ Compaction Size Ratio : 1.1 │ -│ Compaction Threshold : 8 │ -│ Score Size Weight : 0.8 │ -│ Score Count Weight : 0.2 │ -│ Flusher Interval : 1ms │ -│ Compactor Interval : 250ms │ -│ Bloom FPR : 0.01 │ -│ WAL Retry : 10 │ -│ WAL Backoff : 128µs │ -│ SSTable B-Tree Order : 10 │ -│ LRU Size : 1024 │ -│ LRU Evict Ratio : 0.2 │ -│ LRU Access Weight : 0.8 │ -│ File Version : 2 │ -│ Magic Number : 1464421444 │ -│ Directory : /tmp/wildcat_bench/ │ -├──────────────────────────────────────────────────┤ -│ ID Generator State │ -├──────────────────────────────────────────────────┤ -│ Last SST ID : 0 │ -│ Last WAL ID : 1 │ -├──────────────────────────────────────────────────┤ -│ Runtime Statistics │ -├──────────────────────────────────────────────────┤ -│ Active Memtable Size : 1160580 │ -│ Active Memtable Entries : 10005 │ -│ Active Transactions : 0 │ -│ WAL Files : 0 │ -│ Total SSTables : 0 │ -│ Total Entries : 10005 │ -└──────────────────────────────────────────────────┘ -Completed iterprefix: 1260191.80 ops/sec - -Running benchmark: concurrent_writers -Database Stats: -┌──────────────────────────────────────────────────┐ -│ Wildcat DB Stats and Configuration │ -├──────────────────────────────────────────────────┤ -│ Write Buffer Size : 67108864 │ -│ Sync Option : 0 │ -│ Level Count : 7 │ -│ Bloom Filter Enabled : false │ -│ Max Compaction Concurrency : 4 │ -│ Compaction Cooldown : 5s │ -│ Compaction Batch Size : 8 │ -│ Compaction Size Ratio : 1.1 │ -│ Compaction Threshold : 8 │ -│ Score Size Weight : 0.8 │ -│ Score Count Weight : 0.2 │ -│ Flusher Interval : 1ms │ -│ Compactor Interval : 250ms │ -│ Bloom FPR : 0.01 │ -│ WAL Retry : 10 │ -│ WAL Backoff : 128µs │ -│ SSTable B-Tree Order : 10 │ -│ LRU Size : 1024 │ -│ LRU Evict Ratio : 0.2 │ -│ LRU Access Weight : 0.8 │ -│ File Version : 2 │ -│ Magic Number : 1464421444 │ -│ Directory : /tmp/wildcat_bench/ │ -├──────────────────────────────────────────────────┤ -│ ID Generator State │ -├──────────────────────────────────────────────────┤ -│ Last SST ID : 0 │ -│ Last WAL ID : 1 │ -├──────────────────────────────────────────────────┤ -│ Runtime Statistics │ -├──────────────────────────────────────────────────┤ -│ Active Memtable Size : 1160580 │ -│ Active Memtable Entries : 10005 │ -│ Active Transactions : 0 │ -│ WAL Files : 0 │ -│ Total SSTables : 0 │ -│ Total Entries : 10005 │ -└──────────────────────────────────────────────────┘ -Completed concurrent_writers: 233744.08 ops/sec - -Running benchmark: high_contention_writes -Database Stats: -┌──────────────────────────────────────────────────┐ -│ Wildcat DB Stats and Configuration │ -├──────────────────────────────────────────────────┤ -│ Write Buffer Size : 67108864 │ -│ Sync Option : 0 │ -│ Level Count : 7 │ -│ Bloom Filter Enabled : false │ -│ Max Compaction Concurrency : 4 │ -│ Compaction Cooldown : 5s │ -│ Compaction Batch Size : 8 │ -│ Compaction Size Ratio : 1.1 │ -│ Compaction Threshold : 8 │ -│ Score Size Weight : 0.8 │ -│ Score Count Weight : 0.2 │ -│ Flusher Interval : 1ms │ -│ Compactor Interval : 250ms │ -│ Bloom FPR : 0.01 │ -│ WAL Retry : 10 │ -│ WAL Backoff : 128µs │ -│ SSTable B-Tree Order : 10 │ -│ LRU Size : 1024 │ -│ LRU Evict Ratio : 0.2 │ -│ LRU Access Weight : 0.8 │ -│ File Version : 2 │ -│ Magic Number : 1464421444 │ -│ Directory : /tmp/wildcat_bench/ │ -├──────────────────────────────────────────────────┤ -│ ID Generator State │ -├──────────────────────────────────────────────────┤ -│ Last SST ID : 0 │ -│ Last WAL ID : 1 │ -├──────────────────────────────────────────────────┤ -│ Runtime Statistics │ -├──────────────────────────────────────────────────┤ -│ Active Memtable Size : 1160580 │ -│ Active Memtable Entries : 10005 │ -│ Active Transactions : 0 │ -│ WAL Files : 0 │ -│ Total SSTables : 0 │ -│ Total Entries : 10005 │ -└──────────────────────────────────────────────────┘ -Completed high_contention_writes: 245555.90 ops/sec - -Running benchmark: batch_concurrent_writes -Database Stats: -┌──────────────────────────────────────────────────┐ -│ Wildcat DB Stats and Configuration │ -├──────────────────────────────────────────────────┤ -│ Write Buffer Size : 67108864 │ -│ Sync Option : 0 │ -│ Level Count : 7 │ -│ Bloom Filter Enabled : false │ -│ Max Compaction Concurrency : 4 │ -│ Compaction Cooldown : 5s │ -│ Compaction Batch Size : 8 │ -│ Compaction Size Ratio : 1.1 │ -│ Compaction Threshold : 8 │ -│ Score Size Weight : 0.8 │ -│ Score Count Weight : 0.2 │ -│ Flusher Interval : 1ms │ -│ Compactor Interval : 250ms │ -│ Bloom FPR : 0.01 │ -│ WAL Retry : 10 │ -│ WAL Backoff : 128µs │ -│ SSTable B-Tree Order : 10 │ -│ LRU Size : 1024 │ -│ LRU Evict Ratio : 0.2 │ -│ LRU Access Weight : 0.8 │ -│ File Version : 2 │ -│ Magic Number : 1464421444 │ -│ Directory : /tmp/wildcat_bench/ │ -├──────────────────────────────────────────────────┤ -│ ID Generator State │ -├──────────────────────────────────────────────────┤ -│ Last SST ID : 0 │ -│ Last WAL ID : 1 │ -├──────────────────────────────────────────────────┤ -│ Runtime Statistics │ -├──────────────────────────────────────────────────┤ -│ Active Memtable Size : 1160580 │ -│ Active Memtable Entries : 10005 │ -│ Active Transactions : 0 │ -│ WAL Files : 0 │ -│ Total SSTables : 0 │ -│ Total Entries : 10005 │ -└──────────────────────────────────────────────────┘ -Completed batch_concurrent_writes: 230538.71 ops/sec - - -Benchmark Results -================= -Test Ops Ops/sec P50 P95 P99 Max Errors ----- --- ------- --- --- --- --- ------ -fillseq 10000 187359.11 46.9μs 254.6μs 557.8μs 2.0ms 0 -fillprefixed 10000 241326.17 42.6μs 190.8μs 296.7μs 769.4μs 0 -readseq 10000 1820140.95 1.5μs 22.3μs 73.9μs 322.4μs 0 -readrandom 10000 2725031.76 2.5μs 6.2μs 9.3μs 840.3μs 0 -iterseq 10000 3098757.40 3.2ms 3.2ms 3.2ms 3.2ms 0 -iterrandom 100 72778.46 12.7μs 19.2μs 24.5μs 24.5μs 0 -iterprefix 200 1260191.80 617ns 1.1μs 1.7μs 7.1μs 0 -concurrent_writers 10000 233744.08 44.4μs 191.6μs 325.8μs 743.0μs 0 -high_contention_writes 10000 245555.90 40.6μs 184.7μs 312.1μs 874.7μs 0 -batch_concurrent_writes 10000 230538.71 45.3μs 195.8μs 343.8μs 744.6μs 0 - -Summary -========================= -Total Operations: 80300 -Total Duration: 235.617155ms -Average Ops/sec: 340807.10 -Total Bytes Read: 4.4 MB -Total Bytes Written: 5.5 MB -Read Throughput: 18.9 MB/sec -Write Throughput: 23.5 MB/sec -Cleaned up database directory: /tmp/wildcat_bench - -Process finished with the exit code 0 - -``` \ No newline at end of file