fio的配置使用

将fio-2.1.10.tar.gz拷贝到linux服务器的/usr/src/下

解压源码包:

root@grandocean:/usr/src# tar xvf fio-2.1.10.tar.gz 
root@grandocean:/usr/src# cd fio-2.1.10/ 

安装依赖包:

root@grandocean:/usr/src/fio-2.1.10# apt-get install pkg-config gtk+-2.0 libaio-dev 

开启gfio:

root@grandocean:/usr/src/fio-2.1.10# ./configure --enable-gfio 

编译fio:

root@grandocean:/usr/src/fio-2.1.10# make fio 

编译gfio:

root@grandocean:/usr/src/fio-2.1.10# make gfio 

启动server模式:

root@grandocean:/usr/src/fio-2.1.10# ./fio -S

测试脚本:

#! /bin/sh
echo "-------------------------------------------------------------------------------"
echo "iozone测试"  > result.fio
iozone -i 0 -i 1 -i 2 -i 5 -r 4M -s 16G -f /mnt/test1/iotestthru.iso >>  result.fio
sleep 30
echo "-------------------------------------------------------------------------------"
echo "顺序读" >> result.fio
fio -filename=/mnt/fio/cachethrusqread -direct=1 -iodepth 1 -thread  -rw=read -ioengine=psync  -bs=16k  -size=50G -numjobs=30 -runtime=1200 -group_reporting -name=cachesqread  >> result.fio
sleep 30
echo "-------------------------------------------------------------------------------"
echo "顺序写" >> result.fio
fio -filename=/mnt/fio/cachethrusqwrite -direct=1 -iodepth 1 -thread  -rw=write -ioengine=psync  -bs=16k  -size=50G -numjobs=30 -runtime=1200 -group_reporting -name=cachewrite
sleep 30
echo "-------------------------------------------------------------------------------"
echo "随机写" >> result.fio
fio -filename=/mnt/fio/cachethrurandwrite -direct=1 -iodepth 1 -thread  -rw=randwrite -ioengine=psync  -bs=16k  -size=50G -numjobs=30 -runtime=1200 -group_reporting -name=cacherandwrite >> result.fio
sleep 30
echo "-------------------------------------------------------------------------------"
echo "随机读"  >> result.fio
fio -filename=/mnt/fio/cachethrurandread -direct=1 -iodepth 1 -thread  -rw=randread -ioengine=psync  -bs=16k  -size=50G -numjobs=30 -runtime=1200 -group_reporting -name=cacherandread     >>  result.fio
sleep 30
echo "-------------------------------------------------------------------------------"
echo "随机读写比例各50%" >> result.fio
fio -filename=/mnt/fio/cachethrurandreadwrite -direct=1 -iodepth 1 -thread  -rw=randrw -rwmixread=50 -ioengine=psync  -bs=16k  -size=50G -numjobs=30 -runtime=1200 -group_reporting -name=cacherandreadwrite >>  result.fio
echo "-------------------------------------------------------------------------------"

centos7 安装

下载

https://github.com/axboe/fio/archive/fio-3.26.tar.gz

这个版本对gcc有要求,需要支持c11,需要升级到gcc 4.9版本或者以上

yum install centos-release-scl -y
yum install devtoolset-7-toolchain -y
scl enable devtoolset-7 bash
执行完gcc升级到7.3.1了

安装ui相关的库
yum install libgnomeui-devel

make fio
make gfio

写于: 2014年06月12日
更新于: 2015年03月24日

posted @ 2015-03-24 07:46  武汉-磨渣  阅读(517)  评论(0编辑  收藏  举报