FIO (Flexible I/O) – a benchmark tool for any operating system
I have just attended an interesting session held by Martin Nash (@mpnsh) at UKOUG 14 – Liverpool: “The least an Oracle DBA Should Know about Linux Administration” . During this session I had the opportunity to discover some interesting commands and tools such as FIO (Flexible I/O). FIO is a workload generator that can be used both for benchmark and stress/hardware verification.
FIO has support for 19 different types of I/O engines (sync, mmap, libaio, posixaio, SG v3, splice, null, network, syslet, guasi, solarisaio, and more), I/O priorities (for newer Linux kernels), rate I/O, forked or threaded jobs, and much more. It can work on block devices as well as files. fio accepts job descriptions in a simple-to-understand text format.
This tool has the huge advantage to be available for almost all kind of Operating Systems ( POSIX, Linux, BSD, Solaris, HP-UX, AIX ,OS X, Android, Windows). If you want to use this tool in the context of Oracle database I invite you to have a look on the following blog from Yann Neuhaus: Simulating database-like I/O activity with Flexible I/O
In order to install it on ubuntu simply use the following command:
steulet@ThinkPad-T540p:~$ sudo apt-get install fio
After having installed fio you can run your first test. This first test will run 2 gigabyte of IO (read write) in directory /u01/fio.
steulet@ThinkPad-T540p:~$ mkdir /u01/fio
Once the directory have been created we can set up the configuration script as described below. However it is perfectly possible to execute this command in command line without configuration script (fio –name=global –ioengine=posixaio –rw=readwrite –size=2g –directory=/u01/fio –threads=1 –name=myReadWriteTest-Thread1):
Now you can simply run your test with the command below:
steulet@ThinkPad-T540p:~$ fio testfio.fio
The output will looks like the following:
You will find some really good examples and a detailed list of parameters on the following website: http://www.bluestop.org/fio/HOWTO.txt
This tool is really powerful and present the huge advantage to be available for more or less any Operating System. Such advantage will allow you to make some consistent comparison accross different kind of architecture.