解决方案
补充说明:需要对在集群中的每个用于 Ceph 存储的块设备进行测试,并记录结果。鉴于我们使用相同规格的硬盘,所以可以无需针对每个块存储进行测试。但是,同时测试这些磁盘的性能会得到不同的性能表现,所以我们仍旧建议针对这些磁盘同时进行性能测试。
Bandwidth
fio --name=write_bandwidth_test \ --filename=/dev/sdc --filesize=29313144Ki \ --time_based --ramp_time=2s --runtime=1m \ --ioengine=libaio --direct=1 --verify=0 --randrepeat=0 \ --bs=1M --iodepth=64 --rw=write --numjobs=16 --offset_increment=1832071Ki --group_reporting // 经过 5+ 轮测试:min(bandwidth) == 13MBPS; max(bandwidth)==24MBPS; fio --name=read_bandwidth_test \ --filename=/dev/sdc --filesize=29313144Ki \ --time_based --ramp_time=2s --runtime=1m \ --ioengine=libaio --direct=1 --verify=0 --randrepeat=0 \ --bs=1M --iodepth=64 --rw=read --numjobs=4 --thread --offset_increment=1832071Ki // 经过 5+ 轮测试:min(bandwidth) == 88.9MBPS; max(bandwidth) == 90.5MBPS;
IOPS
fio --name=write_iops_test \ --filename=/dev/sdc --filesize=29313144Ki \ --time_based --ramp_time=2s --runtime=1m \ --ioengine=libaio --direct=1 --verify=0 --randrepeat=0 \ --bs=4K --iodepth=256 --rw=randwrite // 经过 5+ 轮测试:min(iops) == 613.32; max(iops) == 793.93; fio --name=read_iops_test \ --filename=/dev/sdc --filesize=29313144Ki \ --time_based --ramp_time=2s --runtime=1m \ --ioengine=libaio --direct=1 --verify=0 --randrepeat=0 \ --bs=4K --iodepth=256 --rw=randread // 经过 5+ 轮测试:min(iops) == 3714.39; max(iops) == 3740.03;
Latency
Write
fio --name=write_latency_test \ --filename=/dev/sdc --filesize=29313144Ki \ --time_based --ramp_time=2s --runtime=1m \ --ioengine=libaio --direct=1 --verify=0 --randrepeat=0 \ --bs=4K --iodepth=4 --rw=randwrite // lat (usec) : 20=0.01%, 50=39.45%, 100=46.92%, 250=1.11%, 500=0.01% // lat (usec) : 750=0.12%, 1000=0.25% // lat (msec) : 2=6.58%, 4=1.20%, 10=0.01%, 20=0.01%, 50=4.15% // lat (msec) : 100=0.11%, 250=0.05%, 500=0.01%, 750=0.01%, >=2000=0.03% // lat (usec) : 20=0.01%, 50=33.40%, 100=52.18%, 250=1.89%, 500=0.01% // lat (usec) : 750=0.11%, 1000=0.20% // lat (msec) : 2=4.27%, 4=0.94%, 10=0.01%, 20=0.01%, 50=6.81% // lat (msec) : 100=0.09%, 250=0.07%, >=2000=0.03% // lat (usec) : 20=0.01%, 50=19.10%, 100=65.27%, 250=3.11% // lat (msec) : 20=0.01%, 50=12.24%, 100=0.12%, 250=0.11%, 500=0.01% // lat (msec) : >=2000=0.03% // 经过 5+ 轮测试,操作多数能在 us 内完成,但是有 20% 所有需要 ms 级别时长;
Read
fio --name=read_latency_test \ --filename=/dev/sdc --filesize=29313144Ki \ --time_based --ramp_time=2s --runtime=1m \ --ioengine=libaio --direct=1 --verify=0 --randrepeat=0 \ --bs=4K --iodepth=4 --rw=randread // -------------------------------------------------------- // iodepth=4 // lat (usec) : 500=0.12%, 750=0.42%, 1000=14.13% // lat (msec) : 2=85.33% // lat (usec) : 500=0.11%, 750=0.44%, 1000=14.69% // lat (msec) : 2=84.77% // lat (usec) : 500=0.11%, 750=0.46%, 1000=15.30% // lat (msec) : 2=84.13%, 4=0.01% // -------------------------------------------------------- // iodepth=8 // lat (usec) : 1000=0.08% // lat (msec) : 2=6.46%, 4=93.45%, 10=0.01% // -------------------------------------------------------- // iodepth=16 // lat (msec) : 2=0.03%, 4=1.03%, 10=98.95% // lat (msec) : 2=0.03%, 4=0.96%, 10=99.01%, 20=0.01% // -------------------------------------------------------- // iodepth=256 // lat (msec) : 20=0.01%, 50=0.05%, 100=99.74%, 250=0.31% // 经过 5+ 轮测试,操作多数(90%)需要 ms 级别时长; // 如果减小队列深度,iodepth=1-2,多数操作能够在 us 内完成; // 如果增加队列深度,iodepth=4-8,多数操作需要在 ms 内完成;