1 总结经验 2 传播分享 3 专业化测试

linux-----fio

上一篇 / 下一篇  2016-05-26 17:32:08 / 个人分类:linux--命令

@font-face { font-family: "Times New Roman"; }@font-face { font-family: "宋体"; }@font-face { font-family: "Tahoma"; }@font-face { font-family: "微软雅黑"; }p.MsoNormal { margin-bottom: 10pt; font-family: Tahoma; font-size: 11pt; }h1 { margin-top: 17pt; margin-bottom: 16.5pt; page-break-after: avoid; line-height: 240%; font-family: Tahoma; font-weight: bold; font-size: 22pt; }p.pre { margin-bottom: 10pt; text-align: left; font-family: 宋体; font-size: 12pt; }p.p { margin: 5pt 0pt; text-align: left; font-family: Tahoma; font-size: 12pt; }span.msoIns { text-decoration: underline; color: blue; }span.msoDel { text-decoration: line-through; color: red; }div.Section0 { }

步骤 :  1  使用putty 工具远程登陆ubuntu 主机

                 2 切换导root 目录下,sudo -s

                 3 使用命令更新源 ,apt-get update

                 4 安装 fio  工具,apt-get install  fio

                 5  查 看设备名称,fdisk  - l  

                 6  如果测试 随机写的 iops ,则运行

fio -filename=设备名称(/vda)  -direct=1 -iodepth=128

 -rw=randwrite -ioengine=libaio -bs=4k -size=10G 

-numjobs=1 -runtime=1000 -group_reporting -name=mytest

                      如果测试随机写的bw,则运行

fio -filename=设备名称  -direct=1 -iodepth=64

 -rw=randwrite -ioengine=libaio -bs=64k -size=10G 

-numjobs=1 -runtime=1000 -group_reporting -name=mytest

参考:

出现的问题:unable  to fetch xxx,please xxxx

参考网站;http://blog.csdn.net/npy_lp/article/details/42080553

 

解决方式: 只要设置妥当DNS服务器即可,如电信网络的设置如下所示。

操作系统Ubuntu 14.04 x64 LTS

编辑DNS 步骤(1-4)

管理员权限下运行  vi /etc/resolv.conf  

命令行模式切换到插入模式:按下字母【i

3添加域名解析服务器:  nameserver  8.8.8.8

4插入模式切换为命令行模式:按【ESC】键

5.保持并退出文件:   :wq    (别忘了冒号)

 6 再次执行sudo apt-get update命令,结果一切正常。

7  安装sudo  apt-get install fio 命令,结果一切正常。

fio命令详解

fio测试工具支持同步(pread/pwrite)和异步(libaio)FIO是测试IOPS的非常好的工具,用来对硬件进行压力测试和验证,支持13种不同的I/O引擎,包括:sync,mmap, libaio, posixaio, SG v3, splice, null, network, syslet, guasi, solarisaio 等等。 

fio 官网地址:http://freshmeat.net/projects/fio/ 

随机读测试: 

随机读: 

fio -filename=/dev/sdb1 -direct=1 -iodepth 1 -thread -rw=randread -ioengine=psync -bs=16k -size=200G -numjobs=10 -runtime=1000 -group_reporting -name=mytest 

顺序读: 

fio -filename=/dev/sdb1 -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=16k -size=200G -numjobs=30 -runtime=1000 -group_reporting -name=mytest 

随机写: 

fio -filename=/letv/fet/test -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=psync -bs=4k -size=50G -numjobs=10 -runtime=1000 -group_reporting -name=dell 3.

顺序写: 

fio -filename=/dev/sdb1 -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=16k -size=200G -numjobs=30 -runtime=1000 -group_reporting -name=mytest 

混合随机读写: 

fio -filename=/dev/sdb1 -direct=1 -iodepth 1 -thread -rw=randrw -rwmixread=70 -ioengine=psync -bs=16k -size=200G -numjobs=30 -runtime=100 -group_reporting -name=mytest -ioscheduler=noop 

同步i/o(顺序写)测试:

fio -filename=/letv/fet/test -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=4k -size=50G -numjobs=10 -runtime=1000 -group_reporting -name=dell

异步i/o(顺序写)测试:

fio -filename=/letv/fet/test -direct=1 -iodepth 1 -thread -rw=write -ioengine=libaio -bs=4k -size=50G -numjobs=10 -runtime=1000 -group_reporting -name=dell

说明: 

filename=/dev/sdb1 测试文件名称,通常选择需要测试的盘的data目录。 

direct=1 测试过程绕**器自带的buffer。使测试结果更真实。 

rw=randwrite 测试随机写的I/O 

rw=randrw 测试随机写和读的I/O 

bs=16k 单次io的块文件大小为16k 

bsrange=512-2048 同上,提定数据块的大小范围 

size=5g 本次的测试文件大小为5g,以每次4kio进行测试。 

numjobs=30 本次的测试线程为30. 

runtime=1000 测试时间为1000秒,如果不写则一直将5g文件分4k每次写完为止。 

ioengine=psync io引擎使用psync方式 

rwmixwrite=30 在混合读写的模式下,写占30% 

group_reporting 关于显示结果的,汇总每个进程的信息。 

lockmem=1g 只使用1g内存进行测试。 

zero_buffers 0初始化系统buffer。 

nrfiles=8 每个进程生成文件的数量。 

psync  同步i/o测试

libaio  异步i/o测试

结果总结:

例如:

read : io(测试了1G的数据)=1024.0MB, bw(带宽)=139643KB/s, iops(每秒钟的IO数)=136 , runt(总运行时间)=  7509msec

 

Centos 系统 

Centos安装 fio 

cd ~

wget http://brick.kernel.dk/snaps/fio-2.2.7.tar.gz

tar -zxf fio-2.2.7.tar.gz

yum install libaio libaio-devel gcc -y

cd fio-2.2.7

make

make install

常见问题:

问题1-bash: make: command not found

一般出现这个-bash: make: command not found提示,是因为安装系统的时候使用的是最小化mini安装,系统没有安装makevim等常用命令,直接yum安装下即可;

yum -y install gcc automake autoconf libtool make

问题2-bash: wget: command not found

yum -y install wget

 

Linux系统中PAC 工具使用

Linux 系统 安装pac工具 后 连接远程 

wget -q -O - http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -

sudo sh -c 'echo "deb http://archive.getdeb.net/ubuntu trusty-getdeb apps" >> /etc/apt/sources.list.d/getdeb.list'

sudo apt-get update

sudo apt-get install pac

注:安装完成此工具后,就不需要pem 转化为ppk 文件

前置条件:

Pac工具已经安装完成

使用步骤:

 

1 在终端运行PAC,启动应用程序, new Connection,输入 HOST 以及private key

点击 save and close 按钮

运行程序,左侧导航栏登陆

出现问题:登陆过程出现密钥的权限问题

解决办法: chmod  400 xx.pem

出现其他的问题:

ubuntu,在安装wine时停在了“正在设定 ttf-mscorefonts-installer”

 

 

解决办法:

TAB 键选择确定

 

 

 

 


TAG:

 

评分:0

我来说两句

Open Toolbar