Create a new file and add following lines to the file. Let's name the file as "fio_script"
[jobname]
rw=read
size=4m
We run fio script by using fio command:
Syntax $fio <scriptname>
Eg: $fio fio_script
Let's understand what each line means:
rw=read specifies the I/O operation that needs to be done.
Homework 1: Goto fio documentation and see what all values can be assigned to rw
Homework 2: Modify above script to perform random read operation
size=4m Size of I/O operation to be done. In our example, we are stating perform 4MB of read operations
Homework 3: In above example, we have given unit of size as 'm'. Goto fio documentation and see what does it mean: 1000*1000 bytes or 1024*1024 bytes?
Homework 4: In above example, what all possible values we could have used as unit for size instead of 'm'. Is unit even required at all? Goto fio documentation and find out.
Homework 5: Modify above script to perform 1073741824 bytes of random read operation
Note:We have not specified the file on which read should happen. In this case, fio automatically first creates a file and then performs read operation on that file.