Linux uses FIO to test disk Iops__linux

Source: Internet
Author: User

http://blog.csdn.net/card_2005/article/details/8765769

Fio is a very good tool for testing iops to stress test and verify hardware, supporting 13 different I/O engines, including: Sync,mmap, Libaio, Posixaio, SG v3, splice, NULL, network, Syslet, Guasi, Solarisaio and so on.
FIO Official website address: http://freshmeat.net/projects/fio/

One, FIO installation
wget http://brick.kernel.dk/snaps/fio-2.0.7.tar.gz
Yum Install Libaio-devel
TAR-ZXVF fio-2.0.7.tar.gz
CD fio-2.0.7
Make
Make install

Second, FIO usage:

Random reads:
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

Description
FILENAME=/DEV/SDB1 test file name, usually select the data directory of the disk you want to test.
The Direct=1 test process bypasses the machine's own buffer. Make the test results more realistic.
Rw=randwrite test for randomly written I/O
RW=RANDRW test Random Write and read I/O
bs=16k Single IO block file size is 16k
bsrange=512-2048, the size range of the data block
size=5g The test file size is 5g and tested at each 4k IO.
NUMJOBS=30 the test thread for this time is 30.
runtime=1000 test time is 1000 seconds, if not write the 5g file will be divided into 4k every time you finish writing.
Ioengine=psync IO engine uses Pync method
Rwmixwrite=30 in mixed read-write mode, write accounted for 30%
Group_reporting about displaying the results, summarize the information for each process.

Furthermore
LOCKMEM=1G only uses 1g of memory for testing.
Zero_buffers uses 0 to initialize the system buffer.
Nrfiles=8 the number of files generated per process.

Sequential reads:
Fio-filename=/dev/sdb1-direct=1-iodepth 1-thread-rw=read-ioengine=psync-bs=16k-size=200g-numjobs=30-runtime=100 0-group_reporting-name=mytest

Random write:
Fio-filename=/dev/sdb1-direct=1-iodepth 1-thread-rw=randwrite-ioengine=psync-bs=16k-size=200g-numjobs=30-runtim E=1000-group_reporting-name=mytest

Sequential write:
Fio-filename=/dev/sdb1-direct=1-iodepth 1-thread-rw=write-ioengine=psync-bs=16k-size=200g-numjobs=30-runtime=10 00-group_reporting-name=mytest

Mixed random Read and write:
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

Third, the actual test example:

[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 Threads
Jobs:1 (f=1): [________________m_____________] [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=[], 40.00th=[], 50.00th=[], 60.00th=[19],
| 70.00th=[], 80.00th=[, 90.00th=[], 95.00th=[79],
| 99.00th=[151], 99.50th=[, 99.90th=[338], 99.95th=[383],
| 99.99th=[523]
BW (KB/S): min=, 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=[], 5.00th=[, 10.00th=[], 20.00th=[74],
| 30.00th=[], 40.00th=[, 50.00th=[], 60.00th=[90],
| 70.00th=[], 80.00th=[, 90.00th=[], 95.00th=[370],
| 99.00th=[1688], 99.50th=[2128], 99.90th=[3088], 99.95th=[3696],
| 99.99th=[5216]
BW (KB/S): min=, 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%

Main view the ioPS of the Red font section above

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.