热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

linuxio测试

近来想了解一下开发环境的IO性能,分别用ddorioniozonebonnie四种工具测试了一下开发环境系统配置如下:IntelSR1625server,2CPU,3
    • 近来想了解一下开发环境的IO性能,分别用dd/orion/iozone/bonnie++四种工具测试了一下



    开发环境系统配置如下:
    Intel SR1625 server , 2 CPU, 32GB内存, 用主板自带卡做了raid1+0,8个7200转SATA硬盘
    操作系统是RHEL 5.3 64位
    因为物理内存是32GB,因此整个过程都选用了60GB+的数据量来测试,以避免cache的影响

    1. 首先用自带的dd命令先测一下, 块大小为8k

    dd只能提供一个大概的测试结果,而且是连续IO 而不是随机IO

    读测试
    # time dd if=/dev/sda2 of=/dev/null bs=8k count=8388608
    8388608+0 records in
    8388608+0 records out
    68719476736 bytes (69 GB) copied, 516.547 seconds, 133 MB/s

    real    8m36.926s
    user    0m0.117s
    sys     0m55.216s

    写测试
    # time dd if=/dev/zero f=/opt/iotest bs=8k count=8388608
    8388608+0 records in
    8388608+0 records out
    68719476736 bytes (69 GB) copied, 888.398 seconds, 77.4 MB/s

    real    14m48.743s
    user    0m3.678s
    sys     2m47.158s

    读写测试
    # time dd if=/dev/sda2 f=/opt/iotest bs=8k count=8388608
    8388608+0 records in
    8388608+0 records out
    68719476736 bytes (69 GB) copied, 1869.89 seconds, 36.8 MB/s

    real    31m10.343s
    user    0m2.613s
    sys     3m25.548s

    2. 接下来用Oracle 的orion 工具来测一下

    解压即可使用
    # gzip orion_linux_x86-64.gz

    测异步IO时需要libaio库
    # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64
    # echo $LD_LIBRARY_PATH
    :/opt/oracle/product/10.2.0/lib:/usr/lib64

    创建配置文件mytest.lun,列出要测试的分区即可. 注意文件名前缀要跟下面的 testname一致
    # vi mytest.lun

    查看mytest.jun内容
    # cat mytest.lun
    /dev/sda2

    先来个simple test
    # ./orion_linux_x86-64 -run simple -testname mytest -num_disks 8

    查看测试结果
    # cat mytest_20081111_1431_summary.txt
    ORION VERSION 11.1.0.7.0

    Commandline:
    -run simple -testname mytest -num_disks 8

    This maps to this test:
    Test: mytest
    Small IO size: 8 KB
    Large IO size: 1024 KB
    IO Types: Small Random IOs, Large Random IOs
    Simulated Array Type: CONCAT
    Write: 0%
    Cache Size: Not Entered
    Duration for each Data Point: 60 seconds
    Small Columns:,      0
    Large Columns:,      0,      1,      2,      3,      4,      5,      6,      7,      8,      9,     10,     11,     12,     13,     14,     15,     16
    Total Data Points: 38

    Name: /dev/sda2 Size: 629143441920
    1 FILEs found.

    Maximum Large MBPS=56.97 @ Small=0 and Large=7
    Maximum Small IOPS=442 @ Small=40 and Large=0
    Minimum Small Latency=14.62 @ Small=1 and Large=0

    最大MBPS为56.97,最大IOPS为442

    再测一下8k随机读操作
    # ./orion_linux_x86-64 -run advanced -testname mytest -num_disks 8 -size_small 8 -size_large 8 -type rand &

    看看结果
    # cat mytest_20081111_1519_summary.txt
    ORION VERSION 11.1.0.7.0

    Commandline:
    -run advanced -testname mytest -num_disks 8 -size_small 8 -size_large 8 -type rand

    This maps to this test:
    Test: mytest
    Small IO size: 8 KB
    Large IO size: 8 KB
    IO Types: Small Random IOs, Large Random IOs
    Simulated Array Type: CONCAT
    Write: 0%
    Cache Size: Not Entered
    Duration for each Data Point: 60 seconds
    Small Columns:,      0
    Large Columns:,      0,      1,      2,      3,      4,      5,      6,      7,      8,      9,     10,     11,     12,     13,     14,     15,     16
    Total Data Points: 38

    Name: /dev/sda2 Size: 629143441920
    1 FILEs found.

    Maximum Large MBPS=3.21 @ Small=0 and Large=13
    Maximum Small IOPS=448 @ Small=38 and Large=0
    Minimum Small Latency=15.16 @ Small=1 and Large=0

    最大MBPS为3.21(这么低??),最大IOPS为448

    再测一下1M顺序读操作, 失败了, 原因不明...
    # ./orion_linux_x86-64 -run advanced -testname mytest -num_disks 8 -size_small 1024 -size_large 1024 -type seq
    ORION: ORacle IO Numbers -- Version 11.1.0.7.0
    mytest_20081114_1349
    Test will take approximately 73 minutes
    Larger caches may take longer

    rwbase_run_test: rwbase_reap_req failed
    rwbase_run_process: rwbase_run_test failed
    rwbase_rwluns: rwbase_run_process failed
    orion_warm_cache: Warming cache failed. Continuing

    看看结果
    # cat mytest_20081111_1620_summary.txt
    ORION VERSION 11.1.0.7.0

    Commandline:
    -run advanced -testname mytest -num_disks 8 -size_small 1024 -size_large 1024 -type seq

    This maps to this test:
    Test: mytest
    Small IO size: 1024 KB
    Large IO size: 1024 KB
    IO Types: Small Random IOs, Large Sequential Streams
    Number of Concurrent IOs Per Stream: 4
    Force streams to separate disks: No
    Simulated Array Type: CONCAT
    Write: 0%
    Cache Size: Not Entered
    Duration for each Data Point: 60 seconds

    没结果,失败

    3. 用iozone 来测一下

    安装
    # tar -xvf iozone3_345.tar
    # make linux-AMD64

    指定 64G的文件,只测read/reread和write/rewrite,记录大小从4k-16k.同时生成一个excel文件iozone.wks
    # ./iozone -Rab iozone.wks -s64G -i 0 -i 1 -y 4k -q 16k
    Iozone: Performance Test of File I/O
    Version $Revision: 3.345 $
    Compiled for 64 bit mode.
    Build: linux-AMD64

    Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins
    Al Slater, Scott Rhine, Mike Wisner, Ken Goss
    Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,
    Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner,
    Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone,
    Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root,
    Fabrice Bacchella, Zhenghua Xue, Qin Li.

    Run began: Tue Nov 11 10:23:25 2008

    Excel chart generation enabled
    Auto Mode
    File size set to 67108864 KB
    Using Minimum Record Size 4 KB
    Using Maximum Record Size 16 KB
    Command line used: ./iozone -Rab iozone.wks -s64G -i 0 -i 1 -y 4k -q 16k
    Output is in Kbytes/sec
    Time Resolution = 0.000001 seconds.
    Processor cache size set to 1024 Kbytes.
    Processor cache line size set to 32 bytes.
    File stride size set to 17 * record size.
    random  random    bkwd   record   stride                                 
    KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
    67108864       4   72882   69470   104898   125512
    67108864       8   72083   69256   133689   109061
    67108864      16   73375   69155   142019   116034

    iozone test complete.
    Excel output is below:

    "Writer report"
    "4"  "8"  "16"
    "67108864"   72882  72083  73375

    "Re-writer report"
    "4"  "8"  "16"
    "67108864"   69470  69256  69155

    "Reader report"
    "4"  "8"  "16"
    "67108864"   104898  133689  142019

    "Re-Reader report"
    "4"  "8"  "16"
    "67108864"   125512  109061  116034

    可以看到,8k的写是72M/s左右,读是133M/s左右,跟dd的结果比较接近

    测一下64G文件 8k随机读写
    # ./iozone -Rab iozone.wks -s64G -i 2 -y 8k -q 8k
    Iozone: Performance Test of File I/O
    Version $Revision: 3.345 $
    Compiled for 64 bit mode.
    Build: linux-AMD64

    Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins
    Al Slater, Scott Rhine, Mike Wisner, Ken Goss
    Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,
    Randy Dunlap, Mark Montague, Dan Million, Gavin Brebner,
    Jean-Marc Zucconi, Jeff Blomberg, Benny Halevy, Dave Boone,
    Erik Habbinga, Kris Strecker, Walter Wong, Joshua Root,
    Fabrice Bacchella, Zhenghua Xue, Qin Li.

    Run began: Fri Nov 14 15:52:01 2008

    Excel chart generation enabled
    Auto Mode
    File size set to 67108864 KB
    Using Minimum Record Size 8 KB
    Using Maximum Record Size 8 KB
    Command line used: ./iozone -Rab iozone.wks -s64G -i 2 -y 8k -q 8k
    Output is in Kbytes/sec
    Time Resolution = 0.000001 seconds.
    Processor cache size set to 1024 Kbytes.
    Processor cache line size set to 32 bytes.
    File stride size set to 17 * record size.
    random  random    bkwd   record   stride                                 
    KB  reclen   write rewrite    read    reread    read   write    read  rewrite     read   fwrite frewrite   fread  freread
    67108864       8
    Error reading block at 6501007360
    read: Success

    出错了(??)

    4. 最后用bonnie++ 测一下

    安装
    # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64
    # ./configure
    # make
    # make install

    开始测试,默认文件大小是内存的2 倍
    # bonnie++ -d /opt/IOTest/ -m sva17 -u root
    Using uid:0, gid:0.
    Writing with putc()...done
    Writing intelligently...done
    Rewriting...done
    Reading with getc()...done
    Reading intelligently...done
    start 'em...done...done...done...
    Create files in sequential order...done.
    Stat files in sequential order...done.
    Delete files in sequential order...done.
    Create files in random order...done.
    Stat files in random order...done.
    Delete files in random order...done.
    Version 1.03e       ------Sequential Output------ --Sequential Input- --Random-
    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
    Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
    sva17           63G 52391  84 35222   7 34323   6 56362  88 131568  10 176.7   0
    ------Sequential Create------ --------Random Create--------
    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
    files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
    16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
    sva17,63G,52391,84,35222,7,34323,6,56362,88,131568,10,176.7,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++

    顺序写: 按字符是52391KB/s,CPU占用率84%;按块是35222KB/s,CPU占用率7%
    顺序读: 按字符是56362KB/s, CPU占用率88%;按块是131568KB/s,CPU占用率10%
    随机读写: 176.7次/s,CPU占用率0%
    后两项全是++ (没结果?)

    结论:不同测试工具构建出来的测试环境不同,侧重点也不一样,得到的结果可能相差比较大。

    MBPS:
    dd 和iozone比较接近,读写分别是130+和70+。
    orion读57左右,写没测(会删掉分区内所有文件!)
    bonnie++ 按块读是130左右,写是35左右;按字符读是56左右,写是52左右
    IOPS:
    dd 无结果
    orion 440左右(只读)
    iozone 出错
    bonnie++ 176.7 (读写)

    Sysbench:

    sysbench --test=fileio --file-total-size=30G prepare
    sysbench --test=fileio --file-total-size=30G --file-test-mode=rndrw --init-rng=on --max-time=300 --max-requests=0 run
    sysbench --num-threads=16 --test=fileio --file-total-size=3G --file-test-mode=rndrw prepare



    推荐阅读
    • 本文讨论了在数据库打开和关闭状态下,重新命名或移动数据文件和日志文件的情况。针对性能和维护原因,需要将数据库文件移动到不同的磁盘上或重新分配到新的磁盘上的情况,以及在操作系统级别移动或重命名数据文件但未在数据库层进行重命名导致报错的情况。通过三个方面进行讨论。 ... [详细]
    • CentOS 7部署KVM虚拟化环境之一架构介绍
      本文介绍了CentOS 7部署KVM虚拟化环境的架构,详细解释了虚拟化技术的概念和原理,包括全虚拟化和半虚拟化。同时介绍了虚拟机的概念和虚拟化软件的作用。 ... [详细]
    • Givenasinglylinkedlist,returnarandomnode'svaluefromthelinkedlist.Eachnodemusthavethe s ... [详细]
    • Java 11相对于Java 8,OptaPlanner性能提升有多大?
      本文通过基准测试比较了Java 11和Java 8对OptaPlanner的性能提升。测试结果表明,在相同的硬件环境下,Java 11相对于Java 8在垃圾回收方面表现更好,从而提升了OptaPlanner的性能。 ... [详细]
    • 开源Keras Faster RCNN模型介绍及代码结构解析
      本文介绍了开源Keras Faster RCNN模型的环境需求和代码结构,包括FasterRCNN源码解析、RPN与classifier定义、data_generators.py文件的功能以及损失计算。同时提供了该模型的开源地址和安装所需的库。 ... [详细]
    • MySQL数据库锁机制及其应用(数据库锁的概念)
      本文介绍了MySQL数据库锁机制及其应用。数据库锁是计算机协调多个进程或线程并发访问某一资源的机制,在数据库中,数据是一种供许多用户共享的资源,如何保证数据并发访问的一致性和有效性是数据库必须解决的问题。MySQL的锁机制相对简单,不同的存储引擎支持不同的锁机制,主要包括表级锁、行级锁和页面锁。本文详细介绍了MySQL表级锁的锁模式和特点,以及行级锁和页面锁的特点和应用场景。同时还讨论了锁冲突对数据库并发访问性能的影响。 ... [详细]
    • STL迭代器的种类及其功能介绍
      本文介绍了标准模板库(STL)定义的五种迭代器的种类和功能。通过图表展示了这几种迭代器之间的关系,并详细描述了各个迭代器的功能和使用方法。其中,输入迭代器用于从容器中读取元素,输出迭代器用于向容器中写入元素,正向迭代器是输入迭代器和输出迭代器的组合。本文的目的是帮助读者更好地理解STL迭代器的使用方法和特点。 ... [详细]
    • Commit1ced2a7433ea8937a1b260ea65d708f32ca7c95eintroduceda+Clonetraitboundtom ... [详细]
    • Android Studio Bumblebee | 2021.1.1(大黄蜂版本使用介绍)
      本文介绍了Android Studio Bumblebee | 2021.1.1(大黄蜂版本)的使用方法和相关知识,包括Gradle的介绍、设备管理器的配置、无线调试、新版本问题等内容。同时还提供了更新版本的下载地址和启动页面截图。 ... [详细]
    • Spring特性实现接口多类的动态调用详解
      本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
    • XML介绍与使用的概述及标签规则
      本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
    • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
      本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
    • 本文介绍了三种方法来实现在Win7系统中显示桌面的快捷方式,包括使用任务栏快速启动栏、运行命令和自己创建快捷方式的方法。具体操作步骤详细说明,并提供了保存图标的路径,方便以后使用。 ... [详细]
    • Python已成为全球最受欢迎的编程语言之一,然而Python程序的安全运行存在一定的风险。本文介绍了Python程序安全运行需要满足的三个条件,即系统路径上的每个条目都处于安全的位置、"主脚本"所在的目录始终位于系统路径中、若python命令使用-c和-m选项,调用程序的目录也必须是安全的。同时,文章还提出了一些预防措施,如避免将下载文件夹作为当前工作目录、使用pip所在路径而不是直接使用python命令等。对于初学Python的读者来说,这些内容将有所帮助。 ... [详细]
    • 本文介绍了在Android Studio中使用命令行build gradle的方法,并解决了一些常见问题,包括手动配置gradle环境变量和解决External Native Build Issues的方法。同时提供了相关参考文章链接。 ... [详细]
    author-avatar
    9asd8fy
    这个家伙很懒,什么也没留下!
    PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
    Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有