08-存储性能测试(Ceph Pacific)

1. 网络带宽测试

1.1 服务端

iperf3 -s -i 1 -p 8888

1.2 客户端

iperf3 -c 172.16.0.1 -i 1 -t 10 -p 8888

2. RADOS基准性能测试(rados bench)

2.1 语法

rados bench -p <pool_name> <seconds> <write|seq|rand> -b <block size> -t 16 --no-cleanup

2.2 选项说明

pool_name:测试所针对的存储池;
seconds:测试所持续的秒数;
<write|seq|rand>:操作模式,write:写,seq:顺序读;rand:随机读;
-b:block size,即块大小,默认为 4M;
-t:读/写并行数,默认为 16;
--no-cleanup:表示测试完成后不删除测试用数据。在做读测试之前,需要使用该参数来运行一遍写测试来产生测试数据,在全部测试结束后可以运行 rados -p <pool_name> cleanup 来清理所有测试数据。

2.3 语法示例

写(bs=4M, numjobs=64):
rados bench -p test 10 write -b 4M -t 64

顺序读(bs=4M, numjobs=64):
rados bench -p test 10 seq -t 64

随机读(bs=4M, numjobs=64):
rados bench -p test 10 rand -t 64

清理数据:
rados -p test cleanup

写(bs=4K):
rados bench -p test 10 write -b 4K -t 32 --no-cleanup

顺序读(bs=4K):
rados bench -p test 10 seq -t 128

随机读(bs=4K):
rados bench -p test 10 rand -t 128

3. RBD基准性能测试(rbd bench)

3.1 创建测试使用的镜像

rbd create testimage --pool test --size 1024 --image-feature layering

3.2 选项说明

--io-size:单位 byte,默认 4K
--io-threads:线程数,默认 16
--io-total:总写入字节,默认 1024M
--io-pattern <seq|rand>:写模式,默认为 seq 即顺序写
--io-type <write|read>:IO类型

3.3 语法示例

随机写(bs=4K, numjobs=16, size=1G):
rbd bench testimage --pool test --io-type write --io-pattern rand --io-total 1G --io-size 4K --io-threads 16

随机读(bs=4K, numjobs=16, size=1G):
rbd bench testimage --pool test --io-type read --io-pattern rand --io-total 1G --io-size 4K --io-threads 16

顺序写(bs=4M):
rbd bench testimage --pool test --io-type write --io-pattern seq --io-total 1G --io-size 4M --io-threads 16

顺序读(bs=4M):
rbd bench testimage --pool test --io-type read --io-pattern seq --io-total 1G --io-size 4M --io-threads 16

4. 块存储性能测试用例

4.1 4K随机读写性能

4K随机写:
fio -filename=/dev/rbd0 -iodepth=128 -direct=1 -bs=4K -size=100G --rw=randwrite -numjobs=16 -thread -time_based -runtime=60 -ioengine=libaio -group_reporting -name=test

4K随机读:
fio -filename=/dev/rbd0 -iodepth=128 -direct=1 -bs=4K -size=100G --rw=randread -numjobs=16 -thread -time_based -runtime=60 -ioengine=libaio -group_reporting -name=test

4.2 1M顺序读写性能

1M顺序写:
fio -filename=/dev/rbd0 -iodepth=128 -direct=1 -bs=1M -size=100G --rw=write -numjobs=16 -thread -time_based -runtime=60 -ioengine=libaio -group_reporting -name=test

1M顺序读:
fio -filename=/dev/rbd0 -iodepth=128 -direct=1 -bs=1M -size=100G --rw=read -numjobs=16 -thread -time_based -runtime=60 -ioengine=libaio -group_reporting -name=test

5. 文件存储性能测试用例

5.1 4K随机读写性能

4K随机写:
fio -filename=/mnt/test/fio.testfile -iodepth=128 -direct=1 -bs=4K -size=10G --rw=randwrite -numjobs=16 -thread -time_based -runtime=60 -ioengine=libaio -group_reporting -name=test

4K随机读:
fio -filename=/mnt/test/fio.testfile -iodepth=128 -direct=1 -bs=4K -size=10G --rw=randread -numjobs=16 -thread -time_based -runtime=60 -ioengine=libaio -group_reporting -name=test

5.2 1M顺序读写性能

1M顺序写:
fio -filename=/mnt/test/fio.testfile -iodepth=128 -direct=1 -bs=1M -size=50G --rw=write -numjobs=4 -thread -time_based -runtime=60 -ioengine=libaio -group_reporting -name=test

1M顺序读:
fio -filename=/mnt/test/fio.testfile -iodepth=128 -direct=1 -bs=1M -size=50G --rw=read -numjobs=4 -thread -time_based -runtime=60 -ioengine=libaio -group_reporting -name=test

6. 对象存储性能测试

测试工具:COSBench
下载地址:https://github.com/intel-cloud/cosbench/releases/tag/v0.4.2.c4
用户手册:COSBenchUserGuide.pdf

影响性能的因素:
    机器核心数:机器核心数较少,开启的 worker 数目较多,容易在上下文切换上产生大量的开销,建议采用32或64核进行压测。
    机器网卡:机器流出的流量受网卡限制,大文件的流量压力测试,建议采用万兆以上的网卡。
    请求网络链路:外网链路质量不一,同时外网下载会产生外网下行流量费用,建议同地域使用内网访问。
    测试时间:性能测试时,建议测试时间适当延长,获取一个较为稳定的数值。
    测试环境:程序运行的 JDK 版本,同样也会影响性能。例如测试 HTTPS,低版本客户端的加密算法存在 GCM BUG,随机数发生器可能存在锁等问题。

6.1 64K小对象性能

    workers(压测线程数):init(10)、prepare(100)、main(100)、cleanup(10)、dispose(10)
    cprefix(存储桶名称前缀):s3testqwer
    containers(存储桶名称数值区间):1-10
    objects(压测对象):prepare(1,1000),main-read(1,1000),main-write(1000,2000)cleanup(1,2000)
    sizes(压测对象大小):64KB
    runtime(压测运行时间):300秒
    压测读比例:100%
    压测写比例:100%

6.2 1M中对象性能

    workers(压测线程数):init(10)、prepare(100)、main(100)、cleanup(10)、dispose(10)
    cprefix(存储桶名称前缀):s3testqwer
    containers(存储桶名称数值区间):1-10
    objects(压测对象数量):prepare(1,1000),main-read(1,1000),main-write(1000,2000)cleanup(1,2000)
    sizes(压测对象大小):1024KB
    runtime(压测运行时间):300秒
    压测读比例:100%
    压测写比例:100%

6.3 32M大对象性能

    workers(压测线程数):init(10)、prepare(100)、main(100)、cleanup(10)、dispose(10)
    cprefix(存储桶名称前缀):s3testqwer
    containers(存储桶名称数值区间):1-10
    objects(压测对象数量):prepare(1,1000),main-read(1,1000),main-write(1000,2000)cleanup(1,2000)
    sizes(压测对象大小):32MB
    runtime(压测运行时间):300秒
    压测读比例:100%
    压测写比例:100%

 

posted @ 2023-02-21 09:38  Varden  阅读(406)  评论(0编辑  收藏  举报