In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Fio is an I / O tool for benchmarking and stress / hardware verification. It supports 19 different types of I / O engines (sync,mmap,libaio,posixaio,SG v3 SpliceGravity, NullGrad, network, etc.), I / O priority (for newer Linux kernels), evaluation I / O, fork or thread jobs, and so on. It works on block devices and files. Fio accepts job descriptions in an easy-to-understand text format. Contains several sample job files. Fio displays a variety of I / O performance information, including full IO latency and percentiles. Fio is widely used in many places for benchmarking, QA and verification purposes. It supports Linux,FreeBSD,NetBSD,OpenBSD,OS XMagi OpenSolaris Personality, Aix Personality, HPPay, UXMagi, Android and Windows.
Fio official website address: http://freshmeat.net/projects/fio/
Installation:
Yum install fio-y
Usage
Fio is divided into sequential read-rw=read, random read-rw=randread, sequential write-rw=write, random write-rw=randwrite, mixed random read-write mode-rw=randrw
Parameters:
Filename: specifies the name of the file (device). You can specify multiple files at the same time, such as filename=/dev/sda:/dev/sdb, by splitting them with colons.
Directory: sets the path prefix for filename. In a later benchmark, the device is specified in this way.
Name: specify the name of job, which means a new job is launched on the command line.
Direct: bool type. If set to true (1), io buffer is not used.
Ioengine: the fio O engine now supports 19 kinds of ioengine. The default value is sync synchronous blocking iMagedLibaio is Linux's native async iMago.
Iodepth: if ioengine is asynchronous, this parameter represents the number of io units held by a batch of submissions. For this parameter, please refer to the article "Fio stress testing tool and io queue depth understanding and misunderstanding".
Rw: Icano mode, random read and write, sequential read and write, and so on.
Bs: I block O block size, default is 4k.
Size: specifies the size of the file processed by job.
Numjobs: specifies the number of clones (threads) of the job.
Time_based: if the file is read and written before the time specified by runtime, it will continue to repeat until the end of runtime time.
Runtime: specifies how many seconds to stop the process. If this parameter is not specified, fio executes until the specified file is fully read and written.
Group_reporting: when numjobs is specified at the same time, the output is displayed by group.
Here is an explanation with numbers:
The direct=1 # test process bypasses the buffer that comes with the machine. Make the test results more realistic rw=randwrite # Test randomly written I bsrange=512 O rw=randrw # Test randomly write and read I bsrange=512 O bs=16k # single io block file size is 16k bsrange=512-2048 # ditto, set block size range size=5G # this test file size is 5g Test with 4k io each time numjobs=30 # the test thread this time is 30 runtime=1000 # test time 1000 seconds, if you don't write, the 5g file will be divided into 4k each time until the ioengine=psync # io engine uses psync mode rwmixwrite=30 # in mixed read-write mode, write accounts for 30% group_reporting # about displaying the results Summarize the information for each process lockmem=1G # use only 1g memory for testing zero_buffers # initialize the system buffer nrfiles=8 # the number of files generated by each process
The filename parameter specifies a bare device (hard disk or partition) to be tested. Do not test on the system partition, which will destroy the system partition and cause the system to crash. The safer way to test the system partition is to create an empty directory under the root directory and specify that directory in the test command using the directory parameter instead of the filename parameter.
For example: to test the root directory
Mkdir / test/
Fio-directory=/test/...
I built a / data
Fio-directory=/data/-name=tempfile.dat-direct=1-rw=randwrite-bs=4k-size=1M-numjobs=16-time_based-runtime=100-group_reporting
Look at the pile of files generated.
# copy the configuration below, change directory=/path/to/test to the address of the mount directory of your test hard drive, and save it as fio.conf
[global] ioengine=libaiodirect=1thread=1norandommap=1randrepeat=0runtime=60ramp_time=6size=1gdirectory=/ data [read4k-rand] stonewallgroup_reportingbs=4krw=randreadnumjobs=8iodepth= 32 [read64k-seq] stonewallgroup_reportingbs=64krw=readnumjobs=4iodepth= 8 [write4k-rand] stonewallgroup_reportingbs=4krw=randwritenumjobs=2iodepth= 4 [write64k-seq] stonewallgroup_reportingbs=64krw=writenumjobs=2iodepth=4
# Test
Fio fio.conf
-
How to run away:
Hard disk performance tested with the dd command I used earlier
Use the dd command to measure the server's throughput (write speed) dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync
Use the dd command to measure server latency dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync
If=/dev/zero (if=/dev/input.file): used to set the input file name read by the dd command.
Of=/tmp/test1.img (of=/path/to/output.file): the name of the output file to which the dd command writes input.file.
Bs=1G (bs=block-size): sets the size of the block read by the dd command. In the example, it is 1 G.
Count=1 (count=number-of-blocks): the number of blocks read by the dd command.
Oflag=dsync (oflag=dsync): use synchronous iBandO. Don't omit this option. This option can help you remove the influence of caching so that it can give you accurate results.
Conv=fdatasyn: this option has the same meaning as oflag=dsync.
A guy in the QQ group said that the fio test is accurate. I believed you as a bad old man.
I executed the following command, sda1 is the disk where the system is located.
Fio-name iops-rw=write-bs=4k-runtime=60-iodepth 32-filename / dev/sda1-ioengine libaio-direct=1
Before the execution was finished, the system broke down. I contacted the computer room to take a look at the error report, and the file system crashed.
What can I do? it's like this:
The dd command tests correctly.
Dd if=/dev/zero of=/tmp/test.dbf bs=4k count=10000 oflag=dsync
The other one will be soon.
Why is the gap so big? It was later found that one was a sas card and the other was a raid card with a faster cache than a sas card.
Finally found the reason, I advise you not to use this fio command, quickly forget him, screw your fio command
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.