如何测试评估windows或linux下数据库的iops

如何测试评估windows或linux下数据库的iops,第1张

测试方法:

使用方式:

安装FIO:

yum install gcc libaio-devel -y

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

tar -zxvf fio-2.0.10.tar.gz

cd fio-2.0.10

make &&make install

测试:

随机读:

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

参数说明:

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,以每次4k的io进行测试。

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

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

ioengine=psync io引擎使用pync方式

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

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

此外

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

zero_buffers 用0初始化系统buffer。

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

###############################################

顺序读:

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=/dev/sdb1 -direct=1 -iodepth 1 -thread -rw=randwrite -ioengine=psync -bs=16k -size=200G -numjobs=30 -runtime=1000 -group_reporting -name=mytest

顺序写:

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

###############################################

实际测试范例:

[root@localhost ~]# 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=mytest1

mytest1: (g=0): rw=randrw, bs=16K-16K/16K-16K, ioengine=psync, iodepth=1

mytest1: (g=0): rw=randrw, bs=16K-16K/16K-16K, ioengine=psync, iodepth=1

fio 2.0.7

Starting 30 threads

Jobs: 1 (f=1): [ [3.5% done] [6935K/3116K /s] [423 /190 iops] [eta 48m:20s] s]

mytest1: (groupid=0, jobs=30): err= 0: pid=23802

read : io=1853.4MB, bw=18967KB/s, iops=1185 , runt=100058msec

clat (usec): min=60 , max=871116 , avg=25227.91, stdev=31653.46

lat (usec): min=60 , max=871117 , avg=25228.08, stdev=31653.46

clat percentiles (msec):

| 1.00th=[ 3], 5.00th=[ 5], 10.00th=[ 6], 20.00th=[ 8],

| 30.00th=[ 10], 40.00th=[ 12], 50.00th=[ 15], 60.00th=[ 19],

| 70.00th=[ 26], 80.00th=[ 37], 90.00th=[ 57], 95.00th=[ 79],

| 99.00th=[ 151], 99.50th=[ 202], 99.90th=[ 338], 99.95th=[ 383],

| 99.99th=[ 523]

bw (KB/s) : min= 26, max= 1944, per=3.36%, avg=636.84, stdev=189.15

write: io=803600KB, bw=8031.4KB/s, iops=501 , runt=100058msec

clat (usec): min=52 , max=9302 , avg=146.25, stdev=299.17

lat (usec): min=52 , max=9303 , avg=147.19, stdev=299.17

clat percentiles (usec):

| 1.00th=[ 62], 5.00th=[ 65], 10.00th=[ 68], 20.00th=[ 74],

| 30.00th=[ 84], 40.00th=[ 87], 50.00th=[ 89], 60.00th=[ 90],

| 70.00th=[ 92], 80.00th=[ 97], 90.00th=[ 120], 95.00th=[ 370],

| 99.00th=[ 1688], 99.50th=[ 2128], 99.90th=[ 3088], 99.95th=[ 3696],

| 99.99th=[ 5216]

bw (KB/s) : min= 20, max= 1117, per=3.37%, avg=270.27, stdev=133.27

lat (usec) : 100=24.32%, 250=3.83%, 500=0.33%, 750=0.28%, 1000=0.27%

lat (msec) : 2=0.64%, 4=3.08%, 10=20.67%, 20=19.90%, 50=17.91%

lat (msec) : 100=6.87%, 250=1.70%, 500=0.19%, 750=0.01%, 1000=0.01%

cpu : usr=1.70%, sys=2.41%, ctx=5237835, majf=0, minf=6344162

IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%

submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%

complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%

issued : total=r=118612/w=50225/d=0, short=r=0/w=0/d=0

Run status group 0 (all jobs):

READ: io=1853.4MB, aggrb=18966KB/s, minb=18966KB/s, maxb=18966KB/s, mint=100058msec, maxt=100058msec

WRITE: io=803600KB, aggrb=8031KB/s, minb=8031KB/s, maxb=8031KB/s, mint=100058msec, maxt=100058msec

Disk stats (read/write):

sdb: ios=118610/50224, merge=0/0, ticks=2991317/6860, in_queue=2998169, util=99.77%

fio是一种 I/O工具,用于基准测试和压力/硬件验证。

它支持19种不同类型的I/O引擎(sync,mmap,libaio,posixaio,SG v3,splice,null,network,syslet,guasi,solarisaio等),I/O优先级(适用于较新的Linux内核) ,评估I/O,分叉或线程作业等等。

它可以在块设备和文件上工作。

fio显示各种I/O性能信息,包括完整的IO延迟和百分位数。

fio在许多地方广泛使用,用于基准测试,QA和验证目的。

它支持Linux,FreeBSD,NetBSD,OpenBSD,OS X,OpenSolaris,AIX,HP-UX,Android和Windows。

filename参数指定某个要测试的裸设备(硬盘或分区),切勿在系统分区做测试,会破坏系统分区,而导致系统崩溃。

若一定要测试系统分区较为安全的方法是:在根目录下创建一个空目录,在测试命令中使用directory参数指定该目录,而不使用filename参数。

Centos7磁盘IOPS压力测试

https://chensir.ink/ea69ccc9cc30

SSD测试第一神器——fio

http://www.ssdfans.com/?p=8288

Fio Output Explained

https://tobert.github.io/post/2014-04-17-fio-output-explained.html

利用BLKTRACE分析IO性能

http://linuxperf.com/?p=161

Blktrace - 使用blktrace分析系统IO

https://www.cnblogs.com/citrus/p/15149707.html

blktrace、blkparse和btt使用

https://jabingu.com/2019/09/17/blktrace-blkparse-btt/

剖析生产系统的I/O模式

http://linuxperf.com/?p=227

FIO:ceph/磁盘IO测试工具

https://www.cnblogs.com/bandaoyu/p/14624847.html

DISK 100% BUSY,谁造成的?

http://linuxperf.com/?p=40

观察网络流量的工具:IPTRAF

http://linuxperf.com/?p=11

观察网络性能时如何选择工具

http://linuxperf.com/?p=20

用PING测网络延迟要注意的几个因素

http://linuxperf.com/?p=4

UOS公有云开放以来,一些用户反应用dd命令测试出来的1TB云硬盘的吞吐率(MBPS)只有128MB/s,而不是我们SLA保证的170MB /s ,这是为什么?下面我会简单介绍如何测试硬盘,RAID,SAN,SSD,云硬盘等,然后再来回答上面的问题。

测试前提

我们在进行测试时,都会分清楚:

测试对象:要区分硬盘、SSD、RAID、SAN、云硬盘等,因为它们有不同的特点

测试指标:IOPS和MBPS(吞吐率),下面会具体阐述

测试工具:Linux下常用Fio、dd工具, Windows下常用IOMeter,

测试参数: IO大小,寻址空间,队列深度,读写模式,随机/顺序模式

测试方法:也就是测试步骤。

测试是为了对比,所以需要定性和定量。在宣布自己的测试结果时,需要说明这次测试的工具、参数、方法,以便于比较。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/6836533.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-03-29
下一篇2023-03-29

发表评论

登录后才能评论

评论列表(0条)

    保存