[PATCH] fio: rename plot script and include in installation
[disktools.git] / README.fio
CommitLineData
e709787c
JA
1fio
2---
3
4fio is a tool that will spawn a number of thread doing a particular
5type of io action as specified by the user. fio takes a number of
6global parameters, each inherited by the thread unless otherwise
7parameters given to them overriding that setting is given.
8
9Options
10-------
11
12$ fio
13 -s IO is sequential
86184d14 14 -b block size in KiB for each io
e709787c 15 -t <sec> Runtime in seconds
e709787c 16 -r For random io, sequence must be repeatable
02bdd9ba 17 -R <on> If one thread fails to meet rate, quit all
e709787c 18 -o <on> Use direct IO is 1, buffered if 0
a0a9b35b
JA
19 -l Generate per-job latency logs
20 -w Generate per-job bandwidth logs
7dd1389e 21 -f <file> Read <file> for job descriptions
e709787c
JA
22
23 <jobs>
24
25The <jobs> format is as follows:
26
27 rw=0/1 0 is read, 1 is write
28 prio=x Run io at prio X, 0-7 is the kernel allowed range
29 prioclass=x Run io at prio class X
30 file=foo Do the io to file foo
8c033f93 31 bs=x Thread blocksize is x bytes
7889f07b 32 bsrange=x-y Mix thread block sizes randomly between x and y
e709787c
JA
33 direct=x 1 for direct IO, 0 for buffered IO
34 delay=x Delay x useconds before each io
35 random IO is randomized
36 sequential IO is sequential
86184d14 37 rate=x Throttle rate to x KiB/sec
4240cfa1
JA
38 ratemin=x Quit if rate of x KiB/sec can't be met
39 ratecycle=x ratemin averaged over x msecs
18e0b78c 40 cpumask=x Allow job to run on CPUs defined by mask
4240cfa1 41 fsync=x If writing, fsync after every x blocks have been written
fc24389f 42 startdelay=x Start this thread x seconds after startup
67903a2e 43 timeout=x Terminate x seconds after startup
43000118
JA
44 aio Use Linux async io
45 aio_depth=x Allow x iocbs in flight
02983297
JA
46 size=x Set file size to x bytes (x string can include k/m/g)
47 offset=x Start io at offset x (x string can include k/m/g)
b95799ca 48 invalidate=x Invalidate page cache for file prior to doing io
74b4b5fb 49 sync=x Use sync writes if x and writing
99c6704f
JA
50 mem=x If x == malloc, use malloc for buffers. If x == shm,
51 use shm for buffers.
98dd52d6 52 exitall When one thread quits, terminate the others
e709787c
JA
53
54
7dd1389e
JA
55Examples using cmd line jobs
56----------------------------
e709787c
JA
57
58Spawn 2 threads, one read and one writer. Both threads want direct and
59sequential io, set these as global options. The reader wants a 4kb block
60size and the writer a 16kb block size, set those as thread options.
61
62$ fio -o1 -s "{rw=0,file=read_file,bs=4096}" "{rw=1,file=write_file,bs=16384}"
63
64Spawn 3 reader threads doing io at priorities 0, 3, and 6. The highest
65prio thread wants direct io, the others buffered. All want a 4kb block
66size.
67
68$ fio -o0 -s -b4096 "{rw=0,file=rf1,prio=6}" "{rw=0,file=rf2,prio=3}" "{rw=0,file=rf3,prio=0,direct=1}"
69
7dd1389e
JA
70Examples using a job file
71-------------------------
72
73A sample job file doing the same as above would look like this:
74
75[read_file]
76rw=0
77bs=4096
78
79[write_file]
80rw=1
81bs=16384
82
83And fio would be invoked as:
84
85$ fio -o1 -s -f file_with_above
86
87The second example would look like this:
88
89[rf1]
90rw=0
91prio=6
92
93[rf2]
94rw=0
95prio=3
96
97[rf3]
98rw=0
99prio=0
100direct=1
101
102And fio would be invoked as:
103
104$ fio -o0 -s -b4096 -f file_with_above
105
47d45203
JA
106'global' is a reserved keyword. When used as the filename, it sets the
107default options for the threads following that section. It is possible
108to have more than one global section in the file, as it only affects
109subsequent jobs.
ed864e24
JA
110
111Also see the examples/ dir for sample job files.
47d45203 112