fio
is a tool that will spawn a number of threads or
processes doing a particular type of io action as specified by the
user.
% lfs setstripe [file,dir] [-c count] [-S size] [-i index]
% lfs getstripe [file,dir]
Note: for a size parameter of 1MB, use -S 1M.
A file automatically inherits the striping parameters of the directory
it is created in, so changing the parameters of a directory is a
convenient way to set the parameters for a collection of files you are
about to create. For instance, if your application creates output
files in a sub-directory called output/
, you can set the
striping parameters on that directory once before your application
runs, and all of your output files will inherit those parameters.
testIO
,
run lfs getstripe ./testIO
. Explain the output of the
command, use the man pages if required.fio/fio --ioengine=libaio --gtod_reduce=1 --bs=1024K --size=1G \ --readwrite=write --thread --numjobs=2 --name=test --directory=./testIOand will produce output like:
test: (g=0): rw=write, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=libaio, iodepth=1 ... Starting 2 threads Jobs: 2 (f=2) test: (groupid=0, jobs=1): err= 0: pid=22754: Mon May 15 18:25:09 2017 write: IOPS=627, BW=628MiB/s (658MB/s)(1024MiB/1631msec) ... test: (groupid=0, jobs=1): err= 0: pid=22755: Mon May 15 18:25:09 2017 write: IOPS=652, BW=653MiB/s (684MB/s)(1024MiB/1569msec) ... Run status group 0 (all jobs): WRITE: bw=1256MiB/s (1317MB/s), 628MiB/s-653MiB/s (658MB/s-684MB/s), io=2048MiB (2147MB), run=1569-1631msecThe command
ls ./testIO
will display the temporary
files fio generated.
Stripe Size (MB) | Stripe Count | No of Threads | Working Set (MB) | Block Size (KB) | Time Taken (ms) | Data Written (MB) | IOPS | B/W (MB/sec) |
---|---|---|---|---|---|---|---|---|
1 | -1 | 4 | 1024 | 1024 | ||||
1 | 2 | 4 | 1024 | 1024 | ||||
1 | 4 | 4 | 1024 | 1024 | ||||
4 | -1 | 4 | 1024 | 1024 | ||||
4 | 2 | 4 | 1024 | 1024 | ||||
4 | 4 | 4 | 1024 | 1024 |