blob: 951550b83f141a1f0063cb563650f4906644f090 [file] [log] [blame]
Elliott Hugheseda3a602017-05-19 18:53:02 -07001Overview and history
2--------------------
Jens Axboeebac4652005-12-08 15:25:21 +01003
Elliott Hugheseda3a602017-05-19 18:53:02 -07004Fio was originally written to save me the hassle of writing special test case
5programs when I wanted to test a specific workload, either for performance
6reasons or to find/reproduce a bug. The process of writing such a test app can
7be tiresome, especially if you have to do it often. Hence I needed a tool that
8would be able to simulate a given I/O workload without resorting to writing a
9tailored test case again and again.
10
11A test work load is difficult to define, though. There can be any number of
12processes or threads involved, and they can each be using their own way of
13generating I/O. You could have someone dirtying large amounts of memory in an
14memory mapped file, or maybe several threads issuing reads using asynchronous
15I/O. fio needed to be flexible enough to simulate both of these cases, and many
16more.
17
18Fio spawns a number of threads or processes doing a particular type of I/O
19action as specified by the user. fio takes a number of global parameters, each
20inherited by the thread unless otherwise parameters given to them overriding
21that setting is given. The typical use of fio is to write a job file matching
22the I/O load one wants to simulate.
Jens Axboeebac4652005-12-08 15:25:21 +010023
Jens Axboe2b02b542005-12-08 15:29:14 +010024
25Source
26------
27
Elliott Hugheseda3a602017-05-19 18:53:02 -070028Fio resides in a git repo, the canonical place is:
Jens Axboe2b02b542005-12-08 15:29:14 +010029
Grant Grundler4649b352013-09-04 08:26:52 -060030 git://git.kernel.dk/fio.git
Jens Axboe97f049c2007-04-23 18:54:55 +020031
Grant Grundler4649b352013-09-04 08:26:52 -060032When inside a corporate firewall, git:// URL sometimes does not work.
33If git:// does not work, use the http protocol instead:
Jens Axboea9bac3f2011-09-29 09:21:49 -060034
Grant Grundler4649b352013-09-04 08:26:52 -060035 http://git.kernel.dk/fio.git
Jens Axboe2b02b542005-12-08 15:29:14 +010036
Elliott Hugheseda3a602017-05-19 18:53:02 -070037Snapshots are frequently generated and :file:`fio-git-*.tar.gz` include the git
38meta data as well. Other tarballs are archives of official fio releases.
Grant Grundler4649b352013-09-04 08:26:52 -060039Snapshots can download from:
Jens Axboe2b02b542005-12-08 15:29:14 +010040
Grant Grundler4649b352013-09-04 08:26:52 -060041 http://brick.kernel.dk/snaps/
Jens Axboe2b02b542005-12-08 15:29:14 +010042
Elliott Hugheseda3a602017-05-19 18:53:02 -070043There are also two official mirrors. Both of these are automatically synced with
44the main repository, when changes are pushed. If the main repo is down for some
45reason, either one of these is safe to use as a backup:
Jens Axboe47334aa2014-06-23 07:52:48 -060046
47 git://git.kernel.org/pub/scm/linux/kernel/git/axboe/fio.git
Elliott Hugheseda3a602017-05-19 18:53:02 -070048
Jens Axboe47334aa2014-06-23 07:52:48 -060049 https://git.kernel.org/pub/scm/linux/kernel/git/axboe/fio.git
50
51or
52
Elliott Hugheseda3a602017-05-19 18:53:02 -070053 git://github.com/axboe/fio.git
54
Jens Axboe47334aa2014-06-23 07:52:48 -060055 https://github.com/axboe/fio.git
56
Jens Axboe1053a102006-06-06 09:23:13 +020057
Jens Axboe726f6ff2007-01-03 21:02:41 +010058Mailing list
59------------
60
Grant Grundler4649b352013-09-04 08:26:52 -060061The fio project mailing list is meant for anything related to fio including
62general discussion, bug reporting, questions, and development.
Jens Axboe2e8552b2008-10-01 09:04:28 +020063
Elliott Hugheseda3a602017-05-19 18:53:02 -070064An automated mail detailing recent commits is automatically sent to the list at
65most daily. The list address is fio@vger.kernel.org, subscribe by sending an
66email to majordomo@vger.kernel.org with
Grant Grundler4649b352013-09-04 08:26:52 -060067
68 subscribe fio
Jens Axboe2e8552b2008-10-01 09:04:28 +020069
Erik Inge Bolsø4f5d1522010-04-14 10:13:57 +020070in the body of the email. Archives can be found here:
71
Grant Grundler4649b352013-09-04 08:26:52 -060072 http://www.spinics.net/lists/fio/
Erik Inge Bolsø4f5d1522010-04-14 10:13:57 +020073
74and archives for the old list can be found here:
Jens Axboe2e8552b2008-10-01 09:04:28 +020075
Grant Grundler4649b352013-09-04 08:26:52 -060076 http://maillist.kernel.dk/fio-devel/
Jens Axboe726f6ff2007-01-03 21:02:41 +010077
78
Elliott Hugheseda3a602017-05-19 18:53:02 -070079Author
80------
81
82Fio was written by Jens Axboe <axboe@kernel.dk> to enable flexible testing of
83the Linux I/O subsystem and schedulers. He got tired of writing specific test
84applications to simulate a given workload, and found that the existing I/O
85benchmark/test tools out there weren't flexible enough to do what he wanted.
86
87Jens Axboe <axboe@kernel.dk> 20060905
88
89
90Binary packages
91---------------
92
93Debian:
94 Starting with Debian "Squeeze", fio packages are part of the official
95 Debian repository. http://packages.debian.org/search?keywords=fio .
96
97Ubuntu:
98 Starting with Ubuntu 10.04 LTS (aka "Lucid Lynx"), fio packages are part
99 of the Ubuntu "universe" repository.
100 http://packages.ubuntu.com/search?keywords=fio .
101
102Red Hat, Fedora, CentOS & Co:
103 Starting with Fedora 9/Extra Packages for Enterprise Linux 4, fio
104 packages are part of the Fedora/EPEL repositories.
105 https://admin.fedoraproject.org/pkgdb/package/rpms/fio/ .
106
107Mandriva:
108 Mandriva has integrated fio into their package repository, so installing
109 on that distro should be as easy as typing ``urpmi fio``.
110
111Solaris:
112 Packages for Solaris are available from OpenCSW. Install their pkgutil
113 tool (http://www.opencsw.org/get-it/pkgutil/) and then install fio via
114 ``pkgutil -i fio``.
115
116Windows:
117 Rebecca Cran <rebecca+fio@bluestop.org> has fio packages for Windows at
118 http://www.bluestop.org/fio/ .
119
120BSDs:
121 Packages for BSDs may be available from their binary package repositories.
122 Look for a package "fio" using their binary package managers.
123
124
Jens Axboebbfd6b02006-06-07 19:42:54 +0200125Building
126--------
127
Elliott Hugheseda3a602017-05-19 18:53:02 -0700128Just type::
Jens Axboebbfd6b02006-06-07 19:42:54 +0200129
Elliott Hugheseda3a602017-05-19 18:53:02 -0700130 $ ./configure
131 $ make
132 $ make install
Jens Axboebbfd6b02006-06-07 19:42:54 +0200133
Elliott Hugheseda3a602017-05-19 18:53:02 -0700134Note that GNU make is required. On BSDs it's available from devel/gmake within
135ports directory; on Solaris it's in the SUNWgmake package. On platforms where
136GNU make isn't the default, type ``gmake`` instead of ``make``.
137
138Configure will print the enabled options. Note that on Linux based platforms,
139the libaio development packages must be installed to use the libaio
140engine. Depending on distro, it is usually called libaio-devel or libaio-dev.
Jens Axboe6de43c12008-04-11 09:16:59 +0200141
Grant Grundler4649b352013-09-04 08:26:52 -0600142For gfio, gtk 2.18 (or newer), associated glib threads, and cairo are required
Elliott Hugheseda3a602017-05-19 18:53:02 -0700143to be installed. gfio isn't built automatically and can be enabled with a
144``--enable-gfio`` option to configure.
Jens Axboe6de43c12008-04-11 09:16:59 +0200145
Elliott Hugheseda3a602017-05-19 18:53:02 -0700146To build fio with a cross-compiler::
147
Aaron Carroll2382dca2013-04-15 08:41:41 +0200148 $ make clean
149 $ make CROSS_COMPILE=/path/to/toolchain/prefix
Elliott Hugheseda3a602017-05-19 18:53:02 -0700150
Aaron Carroll2382dca2013-04-15 08:41:41 +0200151Configure will attempt to determine the target platform automatically.
152
Elliott Hugheseda3a602017-05-19 18:53:02 -0700153It's possible to build fio for ESX as well, use the ``--esx`` switch to
Jens Axboeef7035a2014-06-18 15:30:09 -0700154configure.
155
Jens Axboebbfd6b02006-06-07 19:42:54 +0200156
Bruce Cran53adf642011-01-19 10:41:10 -0700157Windows
Elliott Hugheseda3a602017-05-19 18:53:02 -0700158~~~~~~~
Bruce Cran53adf642011-01-19 10:41:10 -0700159
Elliott Hugheseda3a602017-05-19 18:53:02 -0700160On Windows, Cygwin (http://www.cygwin.com/) is required in order to build
161fio. To create an MSI installer package install WiX 3.8 from
162http://wixtoolset.org and run :file:`dobuild.cmd` from the :file:`os/windows`
163directory.
Bruce Cran53adf642011-01-19 10:41:10 -0700164
Bruce Cran9aa5fe32014-01-28 12:56:53 -0700165How to compile fio on 64-bit Windows:
Bruce Cranf41862f2013-02-02 15:12:41 +0000166
Elliott Hugheseda3a602017-05-19 18:53:02 -0700167 1. Install Cygwin (http://www.cygwin.com/). Install **make** and all
168 packages starting with **mingw64-i686** and **mingw64-x86_64**.
Bruce Cran9aa5fe32014-01-28 12:56:53 -0700169 2. Open the Cygwin Terminal.
170 3. Go to the fio directory (source files).
Elliott Hugheseda3a602017-05-19 18:53:02 -0700171 4. Run ``make clean && make -j``.
Neto, Antonio Jose Rodrigues444310f2013-02-01 08:30:38 +0100172
Elliott Hugheseda3a602017-05-19 18:53:02 -0700173To build fio on 32-bit Windows, run ``./configure --build-32bit-win`` before
174``make``.
Huadong Liu74097112013-02-05 08:43:14 +0100175
Elliott Hugheseda3a602017-05-19 18:53:02 -0700176It's recommended that once built or installed, fio be run in a Command Prompt or
177other 'native' console such as console2, since there are known to be display and
178signal issues when running it under a Cygwin shell (see
179http://code.google.com/p/mintty/issues/detail?id=56 for details).
Bruce Cran78080862013-02-20 20:35:16 +0000180
Bruce Cran53adf642011-01-19 10:41:10 -0700181
Elliott Hugheseda3a602017-05-19 18:53:02 -0700182Documentation
183~~~~~~~~~~~~~
Jens Axboeebac4652005-12-08 15:25:21 +0100184
Elliott Hugheseda3a602017-05-19 18:53:02 -0700185Fio uses Sphinx_ to generate documentation from the reStructuredText_ files.
186To build HTML formatted documentation run ``make -C doc html`` and direct your
187browser to :file:`./doc/output/html/index.html`. To build manual page run
188``make -C doc man`` and then ``man doc/output/man/fio.1``. To see what other
189output formats are supported run ``make -C doc help``.
Aaron Carrolle592a062007-09-14 09:49:41 +0200190
Elliott Hugheseda3a602017-05-19 18:53:02 -0700191.. _reStructuredText: http://www.sphinx-doc.org/rest.html
192.. _Sphinx: http://www.sphinx-doc.org
Jens Axboe35899182014-10-07 20:56:28 -0600193
Jens Axboebebe6392011-10-07 10:00:51 +0200194
Jens Axboe217bc042009-01-07 10:05:14 +0100195Platforms
196---------
197
Jens Axboe1b8c5af2013-12-29 19:42:06 -0700198Fio works on (at least) Linux, Solaris, AIX, HP-UX, OSX, NetBSD, OpenBSD,
Elliott Hugheseda3a602017-05-19 18:53:02 -0700199Windows, FreeBSD, and DragonFly. Some features and/or options may only be
200available on some of the platforms, typically because those features only apply
201to that platform (like the solarisaio engine, or the splice engine on Linux).
Jens Axboe217bc042009-01-07 10:05:14 +0100202
203Some features are not available on FreeBSD/Solaris even if they could be
Elliott Hugheseda3a602017-05-19 18:53:02 -0700204implemented, I'd be happy to take patches for that. An example of that is disk
205utility statistics and (I think) huge page support, support for that does exist
206in FreeBSD/Solaris.
Jens Axboe217bc042009-01-07 10:05:14 +0100207
Elliott Hugheseda3a602017-05-19 18:53:02 -0700208Fio uses pthread mutexes for signalling and locking and some platforms do not
209support process shared pthread mutexes. As a result, on such platforms only
210threads are supported. This could be fixed with sysv ipc locking or other
211locking alternatives.
Jens Axboe217bc042009-01-07 10:05:14 +0100212
Elliott Hugheseda3a602017-05-19 18:53:02 -0700213Other \*BSD platforms are untested, but fio should work there almost out of the
214box. Since I don't do test runs or even compiles on those platforms, your
215mileage may vary. Sending me patches for other platforms is greatly
Jens Axboe217bc042009-01-07 10:05:14 +0100216appreciated. There's a lot of value in having the same test/benchmark tool
217available on all platforms.
218
Elliott Hugheseda3a602017-05-19 18:53:02 -0700219Note that POSIX aio is not enabled by default on AIX. Messages like these::
Cigy Cyriacbf2e8212010-08-10 19:51:11 -0400220
221 Symbol resolution failed for /usr/lib/libc.a(posix_aio.o) because:
222 Symbol _posix_kaio_rdwr (number 2) is not exported from dependent module /unix.
223
Elliott Hugheseda3a602017-05-19 18:53:02 -0700224indicate one needs to enable POSIX aio. Run the following commands as root::
Cigy Cyriacbf2e8212010-08-10 19:51:11 -0400225
226 # lsdev -C -l posix_aio0
227 posix_aio0 Defined Posix Asynchronous I/O
228 # cfgmgr -l posix_aio0
229 # lsdev -C -l posix_aio0
230 posix_aio0 Available Posix Asynchronous I/O
231
Elliott Hugheseda3a602017-05-19 18:53:02 -0700232POSIX aio should work now. To make the change permanent::
Cigy Cyriacbf2e8212010-08-10 19:51:11 -0400233
234 # chdev -l posix_aio0 -P -a autoconfig='available'
235 posix_aio0 changed
Jens Axboe217bc042009-01-07 10:05:14 +0100236
237
Elliott Hugheseda3a602017-05-19 18:53:02 -0700238Running fio
239-----------
Jens Axboe79809112006-06-09 10:14:54 +0200240
Elliott Hugheseda3a602017-05-19 18:53:02 -0700241Running fio is normally the easiest part - you just give it the job file
242(or job files) as parameters::
Jens Axboe79809112006-06-09 10:14:54 +0200243
Elliott Hugheseda3a602017-05-19 18:53:02 -0700244 $ fio [options] [jobfile] ...
Jens Axboe79809112006-06-09 10:14:54 +0200245
Elliott Hugheseda3a602017-05-19 18:53:02 -0700246and it will start doing what the *jobfile* tells it to do. You can give more
247than one job file on the command line, fio will serialize the running of those
248files. Internally that is the same as using the :option:`stonewall` parameter
249described in the parameter section.
250
251If the job file contains only one job, you may as well just give the parameters
252on the command line. The command line parameters are identical to the job
253parameters, with a few extra that control global parameters. For example, for
254the job file parameter :option:`iodepth=2 <iodepth>`, the mirror command line
255option would be :option:`--iodepth 2 <iodepth>` or :option:`--iodepth=2
256<iodepth>`. You can also use the command line for giving more than one job
257entry. For each :option:`--name <name>` option that fio sees, it will start a
258new job with that name. Command line entries following a
259:option:`--name <name>` entry will apply to that job, until there are no more
260entries or a new :option:`--name <name>` entry is seen. This is similar to the
261job file options, where each option applies to the current job until a new []
262job entry is seen.
263
264fio does not need to run as root, except if the files or devices specified in
265the job section requires that. Some other options may also be restricted, such
266as memory locking, I/O scheduler switching, and decreasing the nice value.
267
268If *jobfile* is specified as ``-``, the job file will be read from standard
269input.