• SSD VS 磁盘读写性能调研


    一、安装

    1)简介

    fio是业界最知名的文件系统评测工具,具有多样性的特点,可以针对每一种的io场景进行测试

    2)下载地址

    https://github.com/axboe/fio.git

    3)编译安装

    ./configure
    make 
    下面这步需要 root
    make install
    

    参考: https://www.cnblogs.com/zero-gg/p/9296603.html

    二、实验

    小文件读写
    #100%随机,100%读, 4K
    fio -filename=./b -direct=1 -iodepth 1 -thread -rw=randread -ioengine=psync -bs=4k -size=1G -numjobs=50 -runtime=180 -group_reporting -name=rand_1Gread_4k
    #100%随机,100%写, 4K
    fio -filename=./b -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=psync -bs=4k -size=1G -numjobs=50 -runtime=180 -group_reporting -name=rand_100write_4k
    #100%顺序,100%读 ,4K
    fio -filename=./b -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=4k -size=1G -numjobs=50 -runtime=180 -group_reporting -name=sqe_100read_4k
    #100%顺序,100%写 ,4K
    fio -filename=./b -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=4k -size=1G -numjobs=50 -runtime=180 -group_reporting -name=sqe_100write_4k
    #100%随机,70%读,30%写 4K
    fio -filename=./b -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=psync -bs=4k -size=1G -numjobs=50 -runtime=180 -group_reporting -name=randrw_70read_4k
    大文件读写
    #100%随机,100%读, 4M
    fio -filename=./b -direct=1 -iodepth 1 -thread -rw=randread -ioengine=psync -bs=4M -size=10G -numjobs=50 -runtime=180 -group_reporting -name=rand_10Gread_4M
    #100%随机,100%写, 4M
    fio -filename=./b -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=psync -bs=4M -size=10G -numjobs=50 -runtime=180 -group_reporting -name=rand_100write_4M
    #100%顺序,100%读 ,4M
    fio -filename=./b -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=4M -size=10G -numjobs=50 -runtime=180 -group_reporting -name=sqe_100read_4M
    #100%顺序,100%写 ,4M
    fio -filename=./b -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=4M -size=10G -numjobs=50 -runtime=180 -group_reporting -name=sqe_100write_4M
    #100%随机,70%读,30%写 4M
    fio -filename=./b -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=psync -bs=4M -size=10G -numjobs=50 -runtime=180 -group_reporting -name=randrw_70read_4M
    

    三、实验结果

    1)小文件读写

    SSD
    1、100%随机,100%读,4K
    534MiB/s
    2、100%随机,100%写,4K
    54.0MiB/s
    3、100%顺序,100%读,4K
    525MiB/s
    4、100%顺序,100%写,4K
    55.9MiB/s
    5、100%随机,70%读,30%写 4K
    READ: 92.2MiB/s
    WRITE: 39.6MiB/s
    磁盘
    1、100%随机,100%读,4K
    READ: bw=2589KiB/s (2651kB/s), 2589KiB/s-2589KiB/s (2651kB/s-2651kB/s), io=455MiB (478MB), run=180133-180133msec
    2、100%随机,100%写,4K
    WRITE: bw=2214KiB/s (2267kB/s), 2214KiB/s-2214KiB/s (2267kB/s-2267kB/s), io=391MiB (410MB), run=180644-180644msec
    3、100%顺序,100%读,4K
    READ: bw=39.9MiB/s (41.8MB/s), 39.9MiB/s-39.9MiB/s (41.8MB/s-41.8MB/s), io=7181MiB (7530MB), run=180008-180008msec
    4、100%顺序,100%写,4K
    WRITE: bw=10.2MiB/s (10.7MB/s), 10.2MiB/s-10.2MiB/s (10.7MB/s-10.7MB/s), io=1846MiB (1936MB), run=180631-180631msec
    5、100%随机,70%读,30%写 4K
    READ: bw=1148KiB/s (1175kB/s), 1148KiB/s-1148KiB/s (1175kB/s-1175kB/s), io=202MiB (212MB), run=180102-180102msec
    WRITE: bw=495KiB/s (507kB/s), 495KiB/s-495KiB/s (507kB/s-507kB/s), io=87.1MiB (91.3MB), run=180102-180102msec
    

    2)大文件读写

    SSD
    1、随机读
    READ: bw=560MiB/s (587MB/s), 560MiB/s-560MiB/s (587MB/s-587MB/s), io=98.5GiB (106GB), run=180340-180340msec
    2、随机写
    WRITE: bw=1060MiB/s (1111MB/s), 1060MiB/s-1060MiB/s (1111MB/s-1111MB/s), io=186GiB (200GB), run=180171-180171msec
    3、顺序读
    READ: bw=528MiB/s (554MB/s), 528MiB/s-528MiB/s (554MB/s-554MB/s), io=93.1GiB (99.9GB), run=180371-180371msec
    4、顺序写
    WRITE: bw=1063MiB/s (1114MB/s), 1063MiB/s-1063MiB/s (1114MB/s-1114MB/s), io=187GiB (201GB), run=180174-180174msec
    1、随机读写
    READ: bw=493MiB/s (517MB/s), 493MiB/s-493MiB/s (517MB/s-517MB/s), io=86.9GiB (93.3GB), run=180314-180314msec
    WRITE: bw=214MiB/s (225MB/s), 214MiB/s-214MiB/s (225MB/s-225MB/s), io=37.8GiB (40.6GB), run=180314-180314msec
    磁盘
    1、随机读
    READ: bw=83.8MiB/s (87.9MB/s), 83.8MiB/s-83.8MiB/s (87.9MB/s-87.9MB/s), io=14.9GiB (16.0GB), run=182121-182121msec
    2、随机写
    WRITE: bw=77.6MiB/s (81.3MB/s), 77.6MiB/s-77.6MiB/s (81.3MB/s-81.3MB/s), io=13.8GiB (14.8GB), run=182198-182198msec
    3、顺序读
    READ: bw=248MiB/s (260MB/s), 248MiB/s-248MiB/s (260MB/s-260MB/s), io=43.8GiB (47.1GB), run=180802-180802msec
    4、顺序写
    WRITE: bw=174MiB/s (183MB/s), 174MiB/s-174MiB/s (183MB/s-183MB/s), io=30.8GiB (33.1GB), run=181047-181047msec
    5、混合读写
    READ: bw=62.1MiB/s (65.1MB/s), 62.1MiB/s-62.1MiB/s (65.1MB/s-65.1MB/s), io=11.1GiB (11.9GB), run=182449-182449msec
    WRITE: bw=26.8MiB/s (28.1MB/s), 26.8MiB/s-26.8MiB/s (28.1MB/s-28.1MB/s), io=4892MiB (5130MB), run=182449-182449msec
    

    小文件读写分析

    SSD: 小文件随机与顺序相差不大

    1、目前 SSD 的小文件随机读与顺序读都能到500+M/s。
    2、目前阡陌 SSD 的小文件随机与顺序写都只能到50+M/s, 大文件写能到1000+M/s 。
    3、小文件随机混合读写 SSD 的性能只有90M/s(读)、38M/s(写)。读只有不到原来的1/2, 写只有原来的一半左右。

    磁盘:小文件随机与顺序相差很大,读相差20倍,写相差5倍

    1、磁盘小文件随机读写速度只有2+M/s。
    2、磁盘小文件顺序读速度只有40M/s, 磁盘顺序写速度只有10.2M/s
    3、磁盘小文件混合读写速度只有:读1.1M/s、写0.5M/s,分别是原来的1/2 与1/4 。

    大文件读写分析

    1、SSD 读性能500+M/s,写性能1000+M/s ,顺序或随机相差不大;
    2、磁盘顺序读性能240+M/s,顺序写性能170+M/s,随机读80+M/s,随机写75+M/s,顺序或随机相差大;

    参考:

    SSD 性能对比:http://oserror.com/backend/ssd-principle/

  • 相关阅读:
    【架构师必看】淘宝从百万到千万级并发的14次服务端架构演进之路
    Nginx(四)------nginx 负载均衡
    Nginx(三)------nginx 反向代理
    Nginx(二)------nginx.conf 配置文件
    Nginx(一)------简介与安装
    nginx配置ssl实现https访问
    架构设计的五大原则-SOLID
    ABP开发框架前后端开发系列
    Windows程序通用自动更新模块(C#,.NET4.5以上)
    网络通讯中粘包的处理
  • 原文地址:https://www.cnblogs.com/yuanzhenliu/p/11600500.html
Copyright © 2020-2023  润新知