zoukankan      html  css  js  c++  java
  • I/O性能测试---fio

                       I/O性能测试---fio

     

    官方网站:

    http://freecode.com/projects/fio

    http://brick.kernel.dk/snaps/

     

    简介:

    fio is an I/O tool meant to be used both for benchmark and stress/hardware verification. It has support for 19 different types of I/O engines (sync, mmap, libaio, posixaio, SG v3, splice, null, network, syslet, guasi, solarisaio, and more), I/O priorities (for newer Linux kernels), rate I/O, forked or threaded jobs, and much more. It can work on block devices as well as files. fio accepts job descriptions in a simple-to-understand text format. Several example job files are included. fio displays all sorts of I/O performance information, including complete IO latencies and percentiles. Fio is in wide use in many places, for both benchmarking, QA, and verification purposes. It supports Linux, FreeBSD, NetBSD, OpenBSD, OS X, OpenSolaris, AIX, HP-UX, Android, and Windows.


     

    安装(以CentOS6为例):
    1.yum安装(确保有epel源)
    yum –y install fio
    2.源码安装
    yum –y install gcc gcc-c++ make libaio-devel
    wget http://brick.kernel.dk/snaps/fio-2.2.6.tar.bz2
    tar –xvf fio-2.2.6.tar.bz2 –C /usr/local/src
    cd /usr/local/src/fio-2.2.6
    make && make install

    测试方法:
    1.顺序读(read)
    fio -filename=/dev/vdb -direct=1 -iodepth 128 -thread -rw=read -ioengine=libaio -bs=512K -numjobs=1 -runtime=120 -group_reporting -name=test

    SSD iodepth用128,普通云主机iodepth用64,numjobs用1就可以,否则测出来数据会偏大,bs需要512K以上

      2.顺序写(write)
    fio -filename=/dev/vdb -direct=1 -iodepth 128 -thread -rw=write -ioengine=libaio -bs=512K -numjobs=4 -runtime=120 -group_reporting -name=test

    SSD iodepth用128,普通云主机iodepth用64,numjobs不用太大,bs需512K以上

      3.随机读(randread)
    fio -filename=/dev/vdb -direct=1 -iodepth 128 -thread -rw=randread -ioengine=libaio -bs=4K -numjobs=128 -runtime=120 -group_reporting -name=test

    bs根据测试的块大小进行调整(随机主要看4K,8K),SSD numjobs为128,普通云主机用4或8就可以了

      4.随机写(randwrite)
    fio -filename=/dev/vdb -direct=1 -iodepth 128 -thread -rw=randwrite -ioengine=libaio -bs=4K -numjobs=32 -runtime=120 -group_reporting -name=test

    bs根据测试的块大小进行调整(随机主要看4K,8K),SSD numjobs为32,普通云主机用4或8就可以了,numjobs太大的话反而会带来副作用

      5.顺序混合读写(readwrite)
    fio -filename=/dev/vdb -direct=1 -iodepth 128 -thread -rw=rw -rwmixread=100 -ioengine=libaio -bs=512K -numjobs=8 -runtime=120 -group_reporting -name=test

      6.随机混合读写(randrw)
    fio -filename=/dev/vdb -direct=1 -iodepth 128 -thread -rw=randrw -rwmixread=100 -ioengine=libaio -bs=4K -numjobs=8 -runtime=120 -group_reporting -name=test
    SSD iodepth用128,普通云主机用64

    混合读写的比例调整-rwmixread就可以了,100表示全是读,0表示全是写,50表示一半读一半写,根据需要调整。目前混合读写最好引导用户直接测裸盘,如果测文件的话会暴露出来我们的读IO较差,且读IO过多会导致写IO性能下降。


    还可以通过以下配置静默测试后通过plot绘制图表

    [global]

    ioengine=libaio

    iodepth=128

    time_based

    direct=1

    thread=1

    group_reporting

    randrepeat=0

    norandommap

    numjobs=32

    timeout=6000

    runtime=120


    [randread-4k]

    rw=randread

    bs=4k

    filename=/dev/sdg

    rwmixread=100

    stonewall


    [randwrite-4k]

    rw=randwrite

    bs=4k

    filename=/dev/sdg

    stonewall


    [read-512k]

    rw=read

    bs=512k

    filename=/dev/sdg

    stonewall


    [write-512k]

    rw=write

    bs=512k

    filename=/dev/sdg

    stonewall

     

  • 相关阅读:
    201202
    Android牟利之道(一)界面嵌入有米广告
    SoketException log
    ERROR: 9patch image about.9.png malformed.
    Conversion to Dalvik format failed with error 1
    absolute绝对定位(相对于整个html流)以及不为人知的(fixed)绝对定位(fixed相对于浏览器窗口=不动的div)
    about getElementsByTagName()的那点事
    js 不用onload的loding
    absolute fixed效果 复制网页打开就是代码 http://www.cnblogs.com/0banana0/archive/2011/05/25/2056643.html
    关于datetime的那点事
  • 原文地址:https://www.cnblogs.com/lixuebin/p/10814380.html
Copyright © 2011-2022 走看看