Linux RSSD云盘IO性能压测教程-fio
UCloud快杰云主机的诞生,对于UCloud来说,具有里程碑意义的重大突破。(1)UCloud快杰云主机RSSD云盘的IO隔离属性,彻底解决了本地盘云主机共享宿主IO,互相争抢IO的痛点;(2)同时RSSD云盘的大容量(单数据盘最大支持32T)彻底解决了由于容量上限,而进行的频繁数据迁移的窘境;(3)当然RSSD云盘最闪光的一点还是其高性能、低延迟,单机最高120w IOPS、4.8G的IO吞吐量、0.1ms延迟,也获得业界一致认可;(4)UCloud 快杰云主机也同时兼顾数据安全,其宕机秒级迁移、数据方舟秒级支持12H内秒级恢复等技术,为用户数据安全和业务持续稳定保驾护航!
第三方性能压测数据:阿里云、腾讯云、UCloud 、华为云云主机对比测试报告、高性能云主机如何选?AWS、谷歌云、UCloud、腾讯云测试大PK
1、UCloud官方性能数据说明
(1)详细性能参数
官网地址:https://docs.ucloud.cn/uhost/introduction/disk
(2)RSSD云盘性能与主机实例CPU关系
虚机实例的IO性能与其CPU配置成正比线性关系,虚机核数越多可获得的存储IOPS和吞吐量越高
◆ 如果RSSD云盘的性能不超过实例对应的IO存储能力,实际存储性能以RSSD云盘性能为准
◆ 如果RSSD云盘的性能超过了实例对应的IO存储能力,实际存储性能以该实例对应的存储性能为准
◆ 如果实例核数不在下表中,则实例性能是为不超过该核数的最大性能
例如:CPU核数为50,则其存储IO性能与48核相同
官网地址:https://docs.ucloud.cn/udisk/introduction/performance/account
注:由此可见,快杰云主机RSSD磁盘的性能,与RSSD磁盘大小和CPU核数双重正相关,就像木桶效应,能装多少水,取决于木桶最短的那块木板。所以当你发现IO压测性能无法达到官方提供的参考数据,你就需要去查看一下,是否是CPU核数过低导致的。
2、UCloud RSSD云盘低延迟
最早云盘主机的诞生,也是具有里程碑意义的。它标志着真正意义上在公有云领域,实现计算与存储的分离,这也为宕机秒级迁移技术提供了实现的可能。但在IO性能上,SSD云盘并没有实现质的突破,其性能指标完全无法和本地SSD盘比拟。这也是为什么没有基于SSD云盘云数据库的重要原因。但是随着RSSD云盘的诞生,打破了云盘性能不如本地SSD的历史。
众所周知,云盘是通过网络挂载到云主机上的块存储,理论上网络通,就能实现磁盘的挂载。这是优点也是不折不扣的缺点。为什么呢?优点:在于使用的灵活性,很方便。缺点:在于当跨POD(集群)、跨多台交换机挂载使用时,由于网络传输距离问题和途经交换机吞吐瓶颈等因素,会大大增加IO延迟和IO损耗。
这里我引入了POD的概念,简单介绍一下什么是POD?为什么会有POD的诞生?一个POD可以理解为一个资源池或者一个集群。大家都知道鸡蛋不能放到一个篮子里,那么同理,一个机房或者一个可用区(多个物理机房组成)内的资源也不能都放到一个资源池或一个集群内部,因为一旦这个集群出现异常,那么面临的将是无法容忍的灾难级别的。所以POD的第一个优势在于:(1)分割资源,进而分散风险。(2)天然支持滚动升级。云在不停的发展和迭代,那么就会不停的进行业务变更,要做到完全无损变更发布几乎不可能的,因为你永远不知道下一个bug会出现在哪。所以通过最新的迁移技术(迁移影响已经可以做到秒级闪断),将待升级的POD迁移空后,我们就可以大胆施展拳脚进行升级操作了,哪怕失败也不会影响到用户业务。
(1)SSD云盘时代
针对云盘来讲IO时延对云盘性能影响是非常大的,前面我介绍过,SSD云盘的性能不及本地SSD盘,那么上述跨POD挂载SSD云盘(红线部分),性能就会更差一点。这就是我前面所说的SSD云盘的优势也伴随着劣势。
(2)RSSD云盘时代
RSSD云盘实现了跨时代的性能突破,并作出了IO平均延迟0.1ms的承诺,那么是怎么做到的呢?由上图你可能已经发现,是禁止了RSSD云盘跨POD挂载的情况。由于计算与存储在同一个POD,计算和存储之间的网络传输距离和延迟几乎可以忽略不计,减少了IO网络传输距离和潜在的流量吞吐瓶颈,自然能够实现超低延迟的突破。
3、UCloud RSSD云盘压测演示
注1:压测主机配置:4C8G300G RSSD磁盘。
注2:为了获取稳定可靠的压测数据,压测时间建议1000s起,本次单纯测试,为了方便,缩短压测时间为120s。
(1)时延性能测试
# 1、读时延 [root@10-60-94-140 ~]# fio -direct=1 -iodepth=1 -rw=read -ioengine=libaio -bs=4k -size=200G -numjobs=1 -runtime=1000 -group_reporting -name=test -filename=/data/test test: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=1 fio-2.1.10 Starting 1 process test: Laying out IO file(s) (1 file(s) / 204800MB) Jobs: 1 (f=1): [R] [100.0% done] [23408KB/0KB/0KB /s] [5852/0/0 iops] [eta 00m:00s] test: (groupid=0, jobs=1): err= 0: pid=2373: Wed Mar 30 16:33:14 2022 read : io=23160MB, bw=23715KB/s, iops=5928, runt=1000001msec slat (usec): min=2, max=673, avg= 3.99, stdev= 2.20 clat (usec): min=1, max=7470, avg=163.79, stdev=29.47 lat (usec): min=108, max=7518, avg=167.91, stdev=29.67 clat percentiles (usec): | 1.00th=[ 118], 5.00th=[ 124], 10.00th=[ 139], 20.00th=[ 143], | 30.00th=[ 145], 40.00th=[ 149], 50.00th=[ 153], 60.00th=[ 167], | 70.00th=[ 189], 80.00th=[ 193], 90.00th=[ 199], 95.00th=[ 205], | 99.00th=[ 223], 99.50th=[ 235], 99.90th=[ 314], 99.95th=[ 374], | 99.99th=[ 732] bw (KB /s): min=19024, max=26584, per=100.00%, avg=23719.36, stdev=868.40 lat (usec) : 2=0.01%, 10=0.01%, 100=0.01%, 250=99.71%, 500=0.27% lat (usec) : 750=0.01%, 1000=0.01% lat (msec) : 2=0.01%, 4=0.01%, 10=0.01% cpu : usr=1.12%, sys=3.17%, ctx=5928867, majf=0, minf=9 IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0% submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% issued : total=r=5928846/w=0/d=0, short=r=0/w=0/d=0 latency : target=0, window=0, percentile=100.00%, depth=1 Run status group 0 (all jobs): READ: io=23160MB, aggrb=23715KB/s, minb=23715KB/s, maxb=23715KB/s, mint=1000001msec, maxt=1000001msec Disk stats (read/write): vdb: ios=5928528/7, merge=0/0, ticks=955508/1, in_queue=143, util=100.00% # 2、写时延 [root@10-60-94-140 ~]# fio -direct=1 -iodepth=1 -rw=write -ioengine=libaio -bs=4k -size=200G -numjobs=1 -runtime=120 -group_reporting -name=test -filename=/data/test test: (g=0): rw=write, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=1 fio-2.1.10 Starting 1 process Jobs: 1 (f=1): [W] [100.0% done] [0KB/37716KB/0KB /s] [0/9429/0 iops] [eta 00m:00s] test: (groupid=0, jobs=1): err= 0: pid=3051: Wed Mar 30 16:39:39 2022 write: io=4294.5MB, bw=36645KB/s, iops=9161, runt=120001msec slat (usec): min=2, max=129, avg= 4.34, stdev= 2.34 clat (usec): min=50, max=4461, avg=104.04, stdev=18.26 lat (usec): min=55, max=4467, avg=108.51, stdev=18.90 clat percentiles (usec): | 1.00th=[ 79], 5.00th=[ 92], 10.00th=[ 94], 20.00th=[ 95], | 30.00th=[ 96], 40.00th=[ 97], 50.00th=[ 99], 60.00th=[ 102], | 70.00th=[ 108], 80.00th=[ 115], 90.00th=[ 120], 95.00th=[ 125], | 99.00th=[ 143], 99.50th=[ 155], 99.90th=[ 221], 99.95th=[ 282], | 99.99th=[ 660] bw (KB /s): min=32360, max=39024, per=100.00%, avg=36645.15, stdev=1377.17 lat (usec) : 100=51.71%, 250=48.22%, 500=0.05%, 750=0.01%, 1000=0.01% lat (msec) : 2=0.01%, 4=0.01%, 10=0.01% cpu : usr=3.26%, sys=10.45%, ctx=1099373, majf=0, minf=9 IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0% submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% issued : total=r=0/w=1099370/d=0, short=r=0/w=0/d=0 latency : target=0, window=0, percentile=100.00%, depth=1 Run status group 0 (all jobs): WRITE: io=4294.5MB, aggrb=36645KB/s, minb=36645KB/s, maxb=36645KB/s, mint=120001msec, maxt=120001msec Disk stats (read/write): vdb: ios=0/1099143, merge=0/0, ticks=0/100726, in_queue=23, util=99.96%
(2)吞吐性能测试
# 1、读带宽 [root@10-60-94-140 ~]# fio -direct=1 -iodepth=32 -rw=read -ioengine=libaio -bs=256k -size=200G -numjobs=4 -runtime=120 -group_reporting -name=test -filename=/data/test test: (g=0): rw=read, bs=256K-256K/256K-256K/256K-256K, ioengine=libaio, iodepth=32 ... fio-2.1.10 Starting 4 processes Jobs: 4 (f=4): [RRRR] [100.0% done] [269.8MB/0KB/0KB /s] [1079/0/0 iops] [eta 00m:00s] test: (groupid=0, jobs=4): err= 0: pid=3220: Wed Mar 30 16:44:12 2022 read : io=32492MB, bw=276993KB/s, iops=1082, runt=120119msec slat (usec): min=3, max=2192, avg= 9.48, stdev= 8.17 clat (usec): min=433, max=233566, avg=118279.94, stdev=8130.87 lat (usec): min=438, max=233577, avg=118289.60, stdev=8130.05 clat percentiles (msec): | 1.00th=[ 118], 5.00th=[ 118], 10.00th=[ 119], 20.00th=[ 119], | 30.00th=[ 119], 40.00th=[ 119], 50.00th=[ 119], 60.00th=[ 120], | 70.00th=[ 120], 80.00th=[ 120], 90.00th=[ 120], 95.00th=[ 121], | 99.00th=[ 121], 99.50th=[ 121], 99.90th=[ 121], 99.95th=[ 172], | 99.99th=[ 219] bw (KB /s): min=57029, max=161844, per=25.02%, avg=69305.37, stdev=4689.95 lat (usec) : 500=0.01%, 750=0.01%, 1000=0.01% lat (msec) : 2=0.04%, 4=0.27%, 10=0.11%, 20=0.01%, 50=0.03% lat (msec) : 100=0.04%, 250=99.49% cpu : usr=0.10%, sys=0.30%, ctx=128508, majf=0, minf=2101 IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=99.9%, >=64=0.0% submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.1%, 64=0.0%, >=64=0.0% issued : total=r=129969/w=0/d=0, short=r=0/w=0/d=0 latency : target=0, window=0, percentile=100.00%, depth=32 Run status group 0 (all jobs): READ: io=32492MB, aggrb=276992KB/s, minb=276992KB/s, maxb=276992KB/s, mint=120119msec, maxt=120119msec Disk stats (read/write): vdb: ios=129827/6, merge=0/0, ticks=15348209/1419, in_queue=15271132, util=98.89% # 2、写带宽 [root@10-60-94-140 ~]# fio -direct=1 -iodepth=32 -rw=write -ioengine=libaio -bs=256k -size=200G -numjobs=4 -runtime=120 -group_reporting -name=test -filename=/data/test test: (g=0): rw=write, bs=256K-256K/256K-256K/256K-256K, ioengine=libaio, iodepth=32 ... fio-2.1.10 Starting 4 processes Jobs: 4 (f=4): [WWWW] [100.0% done] [0KB/269.8MB/0KB /s] [0/1079/0 iops] [eta 00m:00s] test: (groupid=0, jobs=4): err= 0: pid=3489: Wed Mar 30 16:51:42 2022 write: io=32492MB, bw=276995KB/s, iops=1082, runt=120118msec slat (usec): min=5, max=7108, avg=21.91, stdev=28.55 clat (usec): min=283, max=231933, avg=118264.20, stdev=8070.79 lat (usec): min=291, max=231953, avg=118286.32, stdev=8070.93 clat percentiles (msec): | 1.00th=[ 118], 5.00th=[ 118], 10.00th=[ 119], 20.00th=[ 119], | 30.00th=[ 119], 40.00th=[ 119], 50.00th=[ 119], 60.00th=[ 120], | 70.00th=[ 120], 80.00th=[ 120], 90.00th=[ 120], 95.00th=[ 121], | 99.00th=[ 121], 99.50th=[ 121], 99.90th=[ 128], 99.95th=[ 167], | 99.99th=[ 215] bw (KB /s): min=55466, max=175776, per=25.01%, avg=69282.70, stdev=5136.95 lat (usec) : 500=0.01%, 750=0.01%, 1000=0.02% lat (msec) : 2=0.12%, 4=0.13%, 10=0.12%, 20=0.03%, 50=0.03% lat (msec) : 100=0.05%, 250=99.48% cpu : usr=0.40%, sys=0.42%, ctx=129441, majf=0, minf=38 IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=99.9%, >=64=0.0% submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.1%, 64=0.0%, >=64=0.0% issued : total=r=0/w=129969/d=0, short=r=0/w=0/d=0 latency : target=0, window=0, percentile=100.00%, depth=32 Run status group 0 (all jobs): WRITE: io=32492MB, aggrb=276994KB/s, minb=276994KB/s, maxb=276994KB/s, mint=120118msec, maxt=120118msec Disk stats (read/write): vdb: ios=0/129825, merge=0/0, ticks=0/15346553, in_queue=15262643, util=99.79%
(3)IOPS性能测试(4k,4*32队列,随机读写)
# 1、读IOPS [root@10-60-94-140 ~]# fio -direct=1 -iodepth=32 -rw=randread -ioengine=libaio -bs=4k -size=200G -numjobs=4 -runtime=120 -group_reporting -name=test -filename=/data/test test: (g=0): rw=randread, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=32 ... fio-2.1.10 Starting 4 processes Jobs: 4 (f=4): [rrrr] [100.0% done] [67132KB/0KB/0KB /s] [16.8K/0/0 iops] [eta 00m:00s] test: (groupid=0, jobs=4): err= 0: pid=3748: Wed Mar 30 16:54:49 2022 read : io=7890.4MB, bw=67327KB/s, iops=16831, runt=120007msec slat (usec): min=1, max=189, avg= 3.47, stdev= 2.50 clat (usec): min=106, max=14884, avg=7599.75, stdev=747.07 lat (usec): min=108, max=14887, avg=7603.33, stdev=746.66 clat percentiles (usec): | 1.00th=[ 6048], 5.00th=[ 7008], 10.00th=[ 7072], 20.00th=[ 7072], | 30.00th=[ 7136], 40.00th=[ 7136], 50.00th=[ 8032], 60.00th=[ 8096], | 70.00th=[ 8096], 80.00th=[ 8096], 90.00th=[ 8160], 95.00th=[ 8160], | 99.00th=[ 8256], 99.50th=[ 8256], 99.90th=[ 8384], 99.95th=[ 8512], | 99.99th=[ 9664] bw (KB /s): min=15992, max=42608, per=25.02%, avg=16847.18, stdev=1235.08 lat (usec) : 250=0.24%, 500=0.17%, 750=0.03%, 1000=0.01% lat (msec) : 2=0.01%, 4=0.01%, 10=99.54%, 20=0.01% cpu : usr=0.63%, sys=1.49%, ctx=458082, majf=0, minf=156 IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=100.0%, >=64=0.0% submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.1%, 64=0.0%, >=64=0.0% issued : total=r=2019924/w=0/d=0, short=r=0/w=0/d=0 latency : target=0, window=0, percentile=100.00%, depth=32 Run status group 0 (all jobs): READ: io=7890.4MB, aggrb=67326KB/s, minb=67326KB/s, maxb=67326KB/s, mint=120007msec, maxt=120007msec Disk stats (read/write): vdb: ios=2019321/6, merge=0/0, ticks=15250526/85, in_queue=15009984, util=99.95% # 2、写IOPS [root@10-60-94-140 ~]# fio -direct=1 -iodepth=32 -rw=randwrite -ioengine=libaio -bs=4k -size=200G -numjobs=4 -runtime=120 -group_reporting -name=test -filename=/data/test test: (g=0): rw=randwrite, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=32 ... fio-2.1.10 Starting 4 processes Jobs: 4 (f=4): [wwww] [100.0% done] [0KB/67132KB/0KB /s] [0/16.8K/0 iops] [eta 00m:00s] test: (groupid=0, jobs=4): err= 0: pid=3818: Wed Mar 30 16:57:28 2022 write: io=7890.2MB, bw=67325KB/s, iops=16831, runt=120008msec slat (usec): min=2, max=840, avg= 4.48, stdev= 4.56 clat (usec): min=78, max=17717, avg=7599.05, stdev=750.53 lat (usec): min=81, max=17719, avg=7603.63, stdev=750.19 clat percentiles (usec): | 1.00th=[ 6048], 5.00th=[ 7072], 10.00th=[ 7072], 20.00th=[ 7072], | 30.00th=[ 7136], 40.00th=[ 7136], 50.00th=[ 8032], 60.00th=[ 8096], | 70.00th=[ 8096], 80.00th=[ 8096], 90.00th=[ 8160], 95.00th=[ 8160], | 99.00th=[ 8160], 99.50th=[ 8256], 99.90th=[ 8256], 99.95th=[ 8512], | 99.99th=[11456] bw (KB /s): min=16264, max=36280, per=25.02%, avg=16847.16, stdev=1111.83 lat (usec) : 100=0.01%, 250=0.17%, 500=0.26%, 750=0.01%, 1000=0.01% lat (msec) : 2=0.01%, 4=0.01%, 10=99.54%, 20=0.02% cpu : usr=0.84%, sys=2.05%, ctx=462531, majf=0, minf=32 IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=100.0%, >=64=0.0% submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0% complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.1%, 64=0.0%, >=64=0.0% issued : total=r=0/w=2019874/d=0, short=r=0/w=0/d=0 latency : target=0, window=0, percentile=100.00%, depth=32 Run status group 0 (all jobs): WRITE: io=7890.2MB, aggrb=67324KB/s, minb=67324KB/s, maxb=67324KB/s, mint=120008msec, maxt=120008msec Disk stats (read/write): vdb: ios=0/2019308, merge=0/0, ticks=0/15236212, in_queue=15035526, util=99.95%
(4)测试脚本
[root@10-60-94-140 ~]# vim rssd_test.sh #!/bin/bash numjobs=16 # 测试线程数,要求不要超过CPU核数, 默认16 iodepth=32 # 每个线程IO队列深度, 默认32 bs=4k # 每个I/O大小, 默认4k rw=randread # 读写方式, 默认随机读 dev_name=vdb # 测试的块设备名, 默认vdb if [[ $# == 0 ]]; then echo "Default test: `basename $0` $numjobs $iodepth $bs $rw $dev_name" echo "Or you can specify paramter:" echo "`basename $0` numjobs iodepth bs rw dev_name" elif [[ $# == 5 ]]; then numjobs=$1 iodepth=$2 bs=$3 rw=$4 dev_name=$5 else echo "paramter number error!" echo "`basename $0` numjobs iodepth bs rw dev_name" exit 1 fi nr_cpus=`cat /proc/cpuinfo |grep "processor" |wc -l` if [ $nr_cpus -lt $numjobs ];then echo "Numjobs is more than cpu cores, exit!" exit -1 fi nu=$((numjobs+1)) cpulist="" for ((i=1;i<10;i++)) do list=`cat /sys/block/${dev_name}/mq/*/cpu_list | awk '{if(i<=NF) print $i;}' i="$i" | tr -d ',' | tr '\n' ','` if [ -z $list ];then break fi cpulist=${cpulist}${list} done spincpu=`echo $cpulist | cut -d ',' -f 2-${nu}` # 不使用0号核 echo $spincpu echo $numjobs echo 2 > /sys/block/${dev_name}/queue/rq_affinity sleep 5 # 执行fio命令 fio --ioengine=libaio --runtime=30s --numjobs=${numjobs} --iodepth=${iodepth} --bs=${bs} --rw=${rw} --filename=/dev/${dev_name} --time_based=1 --direct=1 --name=test --group_reporting --cpus_allowed=$spincpu --cpus_allowed_policy=split
作者:UStarGao
链接:https://www.starcto.com/stress-test/283.html
来源:STARCTO
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
UCloud云平台推荐
随便看看
- 2022-12-14Windows游戏服务器缺少.NET3.5环境依赖而诱发的时间戳转换问题
- 2021-08-31Docker自建容器实例迁移至UCloud 容器实例Cube
- 2022-08-02SmartPing网络质量(PING)检测工具
- 2021-09-04Linux磁盘UUID冲突解决方案
- 2021-10-28PostgreSQL日志轮滚配置教程