wanghenshui / wanghenshui.github.io

my blog, please do not fork
https://wanghenshui.github.io
Other
4 stars 1 forks source link

speedb压测数据 #67

Closed wanghenshui closed 1 year ago

wanghenshui commented 1 year ago

speedb 这个实际上是rocksdb旧的版本的性能

 TEST_TMPDIR=/data/tmp/dbbench ./db_bench --benchmarks=fillrandom,readrandom -max_background_jobs=12 -num=400000000 -target_file_size_base=33554432
Set seed to 1668854433262280 because --seed was 0
Initializing database Options from the specified file
Initializing database Options from command-line flags
Speedb:     version 2.1
Date:       Sat Nov 19 18:40:33 2022
CPU:        32 * AMD Ryzen 9 7950X 16-Core Processor
CPUCache:   1024 KB
Keys:       16 bytes each (+ 0 bytes user-defined timestamp)
Values:     100 bytes each (50 bytes after compression)
Entries:    400000000
Prefix:    0 bytes
Keys per prefix:    0
RawSize:    44250.5 MB (estimated)
FileSize:   25177.0 MB (estimated)
Write rate: 0 bytes/second
Read rate: 0 ops/second
Compression: Snappy
Compression sampling rate: 0
Memtablerep: speedb.HashSpdRepFactory
Perf Level: 1
------------------------------------------------
Initializing database Options from the specified file
Initializing database Options from command-line flags
DB path: [/data/tmp/dbbench/dbbench]
fillrandom   :       2.168 micros/op 461230 ops/sec;   51.0 MB/s
DB path: [/data/tmp/dbbench/dbbench]
readrandom   :       9.694 micros/op 103153 ops/sec;    7.2 MB/s (252837834 of 400000000 found)
wanghenshui commented 1 year ago

rocksd 7.8性能很好

TEST_TMPDIR=/data/tmp/dbbench ./db_bench --benchmarks=fillrandom,readrandom -max_background_jobs=12 -num=400000000 -target_file_size_base=33554432
Set seed to 1668860098950365 because --seed was 0
Initializing RocksDB Options from the specified file
Initializing RocksDB Options from command-line flags
Integrated BlobDB: blob cache disabled
RocksDB:    version 7.9.0
Date:       Sat Nov 19 20:14:59 2022
CPU:        32 * AMD Ryzen 9 7950X 16-Core Processor
CPUCache:   1024 KB
Keys:       16 bytes each (+ 0 bytes user-defined timestamp)
Values:     100 bytes each (50 bytes after compression)
Entries:    400000000
Prefix:    0 bytes
Keys per prefix:    0
RawSize:    44250.5 MB (estimated)
FileSize:   25177.0 MB (estimated)
Write rate: 0 bytes/second
Read rate: 0 ops/second
Compression: Snappy
Compression sampling rate: 0
Memtablerep: SkipListFactory
Perf Level: 1
------------------------------------------------
Initializing RocksDB Options from the specified file
Initializing RocksDB Options from command-line flags
Integrated BlobDB: blob cache disabled
DB path: [/data/tmp/dbbench/dbbench]
fillrandom   :       1.484 micros/op 673628 ops/sec 593.799 seconds 400000000 operations;   74.5 MB/s
DB path: [/data/tmp/dbbench/dbbench]
readrandom   :       7.251 micros/op 137913 ops/sec 2900.375 seconds 400000000 operations;    9.6 MB/s (252837084 of 400000000 found)
wanghenshui commented 1 year ago

我使用的固态是凯侠 rc20 1t

KIOXIA-EXCERIA G2 SSD 1T

磁盘压测用的disk explorer,我自己的fork版本,把device和filename拆开了,不然有可能不小心把磁盘抹了

sudo ./diskplorer.py /dev/nvme1n1 --filename=/data/tmp/tempfile --result-file koxia.json --size-limit=1G

Figure_1

根据这个表,上面的压测是符合这个磁盘效果的,如果OPS超过40万,确实延迟1ms了,优化方向要更集中,尽可能大块带小OPS

看他们测的弹性云配的ssd,感觉还不如我这个性能好 https://github.com/scylladb/diskplorer

主要是延迟。光说带宽5000M没啥用,延迟过1ms对于程序其他命令的空间就比较小了

我观察iostat都是磁盘瓶颈. 默认走iouring

wanghenshui commented 1 year ago

使用speedb的特性,两个都开

TEST_TMPDIR=/data/tmp ./db_bench -filter_uri=speedb.PairedBloomFilter:23.4 --memtablerep=speedb.HashSpdRepFactory --benchmarks=fillrandom,readrandom -max_background_jobs=12 -num=400000000 -target_file_size_base=33554432
Set seed to 1669043265162570 because --seed was 0
Initializing database Options from the specified file
Initializing database Options from command-line flags
Speedb:     version 2.1
Date:       Mon Nov 21 23:07:45 2022
CPU:        32 * AMD Ryzen 9 7950X 16-Core Processor
CPUCache:   1024 KB
Keys:       16 bytes each (+ 0 bytes user-defined timestamp)
Values:     100 bytes each (50 bytes after compression)
Entries:    400000000
Prefix:    0 bytes
Keys per prefix:    0
RawSize:    44250.5 MB (estimated)
FileSize:   25177.0 MB (estimated)
Write rate: 0 bytes/second
Read rate: 0 ops/second
Compression: Snappy
Compression sampling rate: 0
Memtablerep: speedb.HashSpdRepFactory
Perf Level: 1
------------------------------------------------
Initializing database Options from the specified file
Initializing database Options from command-line flags
DB path: [/data/tmp/dbbench]
fillrandom   :       1.675 micros/op 597021 ops/sec;   66.0 MB/s
DB path: [/data/tmp/dbbench]
readrandom   :       2.818 micros/op 354856 ops/sec;   24.8 MB/s (252838052 of 400000000 found)

能看到这个读性能确实提高不少

wanghenshui commented 1 year ago
TEST_TMPDIR=/data/tmp ./db_bench -filter_uri=speedb.PairedBloomFilter:23.4  --benchmarks=fillrandom,readrandom -max_background_jobs=12 -num=400000000 -target_file_size_base=33554432
Set seed to 1669045195061850 because --seed was 0
Initializing database Options from the specified file
Initializing database Options from command-line flags
Speedb:     version 2.1
Date:       Mon Nov 21 23:39:55 2022
CPU:        32 * AMD Ryzen 9 7950X 16-Core Processor
CPUCache:   1024 KB
Keys:       16 bytes each (+ 0 bytes user-defined timestamp)
Values:     100 bytes each (50 bytes after compression)
Entries:    400000000
Prefix:    0 bytes
Keys per prefix:    0
RawSize:    44250.5 MB (estimated)
FileSize:   25177.0 MB (estimated)
Write rate: 0 bytes/second
Read rate: 0 ops/second
Compression: Snappy
Compression sampling rate: 0
Memtablerep: speedb.HashSpdRepFactory
Perf Level: 1
------------------------------------------------
Initializing database Options from the specified file
Initializing database Options from command-line flags
DB path: [/data/tmp/dbbench]
fillrandom   :       1.668 micros/op 599498 ops/sec;   66.3 MB/s
DB path: [/data/tmp/dbbench]
readrandom   :       2.886 micros/op 346548 ops/sec;   24.2 MB/s (252848855 of 400000000 found)
wanghenshui commented 1 year ago
 TEST_TMPDIR=/data/tmp ./db_bench  --memtablerep=speedb.HashSpdRepFactory --benchmarks=fillrandom,readrandom -max_background_jobs=12 -num=400000000 -target_file_size_base=33554432
Set seed to 1669126560973431 because --seed was 0
Initializing database Options from the specified file
Initializing database Options from command-line flags
Speedb:     version 2.1
Date:       Tue Nov 22 22:16:01 2022
CPU:        32 * AMD Ryzen 9 7950X 16-Core Processor
CPUCache:   1024 KB
Keys:       16 bytes each (+ 0 bytes user-defined timestamp)
Values:     100 bytes each (50 bytes after compression)
Entries:    400000000
Prefix:    0 bytes
Keys per prefix:    0
RawSize:    44250.5 MB (estimated)
FileSize:   25177.0 MB (estimated)
Write rate: 0 bytes/second
Read rate: 0 ops/second
Compression: Snappy
Compression sampling rate: 0
Memtablerep: speedb.HashSpdRepFactory
Perf Level: 1
------------------------------------------------
Initializing database Options from the specified file
Initializing database Options from command-line flags
DB path: [/data/tmp/dbbench]
fillrandom   :       2.079 micros/op 480928 ops/sec;   53.2 MB/s
DB path: [/data/tmp/dbbench]
readrandom   :      14.335 micros/op 69760 ops/sec;    4.9 MB/s (252857251 of 400000000 found)