「Ceph」- 通过 fio 命令,测试块存储性能

  CREATED BY JENKINSBOT

注意,需要对在集群中的每个用于 Ceph 存储的块设备进行测试,并记录结果;

on RBD

cat > write-4m.fio <<EOF
[write-4m]
description="write test with block size of 4M"
ioengine=rbd
clientname=admin
pool=benchmark-rados-bench
rbdname=block-dev-1
iodepth=32
runtime=120
rw=write
bs=4M
EOF

fio write-4m.fio

RBD with rados bench

通过 rados bench 命令:

bench <seconds> write|seq|rand [-t concurrent_operations] [--no-cleanup] [--run-name run_name] [--no-hints] [--reuse-bench]
                                default is 16 concurrent IOs and 4 MB ops
                                default is to clean up after write benchmark
                                default run-name is 'benchmark_last_metadata'

seq and rand are read benchmarks, either sequential or random.

// 需要先运行 write 测试,以写入数据,用于后面的读取测试;
// 但是,我们没有找到该 write 属于 rand 还是 seq 模式;

# rados bench -p benchmark-rados-bench 60 write --no-cleanup -t 32 -b 1M
hints = 1
Maintaining 32 concurrent writes of 1048576 bytes to objects of size 1048576 for up to 60 seconds or 0 objects
Object prefix: benchmark_data_laptop-asus-k53sd_4090139
  sec Cur ops   started  finished  avg MB/s  cur MB/s last lat(s)  avg lat(s)
...
   48      32      1581      1549   32.2665        42    0.851067    0.979014
   49      32      1608      1576   32.1589        27    0.863697    0.980051
   50      32      1652      1620   32.3956        44    0.556496    0.983059
   51      32      1686      1654    32.427        34    0.432927    0.980162
   52      32      1707      1675   32.2072        21     1.12784    0.979656
   53      32      1744      1712   32.2975        37     0.96849    0.984544
...
  sec Cur ops   started  finished  avg MB/s  cur MB/s last lat(s)  avg lat(s)
   60      32      1988      1956   32.5954        32     1.02473    0.976075
Total time run:         60.6794
Total writes made:      1988
Write size:             1048576
Object size:            1048576
Bandwidth (MB/sec):     32.7623
Stddev Bandwidth:       10.2822
Max bandwidth (MB/sec): 52
Min bandwidth (MB/sec): 0
Average IOPS:           32
Stddev IOPS:            10.2822
Max IOPS:               52
Min IOPS:               0
Average Latency(s):     0.972106
Stddev Latency(s):      0.427355
Max latency(s):         3.40564
Min latency(s):         0.02613


// 顺序读取测试,针对刚才写入数据

# rados bench -p benchmark-rados-bench 60 seq -t 32
hints = 1
  sec Cur ops   started  finished  avg MB/s  cur MB/s last lat(s)  avg lat(s)
    0       0         0         0         0         0           -           0
    1      32       217       185   184.949       185    0.253322     0.15118
    2      32       406       374   186.953       189    0.454107     0.15539
    3      32       604       572   190.625       198    0.073045     0.16255
    4      32       780       748   186.962       176   0.0393228    0.165087
    5      32       928       896   179.167       148   0.0247802    0.169356
    6      32      1086      1054   175.636       158   0.0269572    0.176997
    7      32      1258      1226   175.113       172   0.0232565     0.17913
    8      32      1413      1381   172.594       155   0.0316313    0.180196
    9      32      1563      1531   170.082       150   0.0293289    0.184506
   10      32      1765      1733   173.271       202    0.121964    0.179903
Total time run:       10.8224
Total reads made:     1988
Read size:            1048576
Object size:          1048576
Bandwidth (MB/sec):   183.693
Average IOPS:         183
Stddev IOPS:          19.9391
Max IOPS:             202
Min IOPS:             148
Average Latency(s):   0.17253
Max latency(s):       0.816741
Min latency(s):       0.0125693

// 随机读取测试,针对刚才写入数据

# rados bench -p "pool-name" 10 rand
# rados bench -p benchmark-rados-bench 60 rand -t 32
hints = 1
  sec Cur ops   started  finished  avg MB/s  cur MB/s last lat(s)  avg lat(s)
    0       0         0         0         0         0           -           0
    1      32       255       223   222.948       223   0.0296851    0.128705
    2      32       444       412   205.964       189   0.0342931    0.132819
    3      32       662       630   209.968       218   0.0595981    0.147189
    4      32       894       862    215.47       232   0.0284013    0.143189
    5      32      1125      1093   218.571       231   0.0383546    0.143222
    6      32      1378      1346   224.303       253   0.0189111    0.139522
    7      32      1650      1618   231.112       272   0.0258337    0.135715
...
Total time run:       60.1821
Total reads made:     16498
Read size:            1048576
Object size:          1048576
Bandwidth (MB/sec):   274.135
Average IOPS:         274
Stddev IOPS:          53.8228
Max IOPS:             424
Min IOPS:             185
Average Latency(s):   0.116254
Max latency(s):       1.45039
Min latency(s):       0.00138064