[PATCH] fio: Add option for setting cpu affinity mask
[disktools.git] / README.fio
1 fio
2 ---
3
4 fio is a tool that will spawn a number of thread doing a particular
5 type of io action as specified by the user. fio takes a number of
6 global parameters, each inherited by the thread unless otherwise
7 parameters given to them overriding that setting is given.
8
9 Options
10 -------
11
12 $ fio
13         -s IO is sequential
14         -b block size in KiB for each io
15         -t <sec> Runtime in seconds
16         -w Write statistics
17         -r For random io, sequence must be repeatable
18         -o <on> Use direct IO is 1, buffered if 0
19         -f <file> Read <file> for job descriptions
20
21         <jobs>
22
23 The <jobs> format is as follows:
24
25         rw=0/1          0 is read, 1 is write
26         prio=x          Run io at prio X, 0-7 is the kernel allowed range
27         prioclass=x     Run io at prio class X
28         file=foo        Do the io to file foo
29         bs=x            Thread blocksize is x KiB
30         direct=x        1 for direct IO, 0 for buffered IO
31         delay=x         Delay x useconds before each io
32         random          IO is randomized
33         sequential      IO is sequential
34         rate=x          Throttle rate to x KiB/sec
35         cpumask=x       Allow job to run on CPUs defined by mask
36
37
38 Examples using cmd line jobs
39 ----------------------------
40
41 Spawn 2 threads, one read and one writer. Both threads want direct and
42 sequential io, set these as global options. The reader wants a 4kb block
43 size and the writer a 16kb block size, set those as thread options.
44
45 $ fio -o1 -s "{rw=0,file=read_file,bs=4096}" "{rw=1,file=write_file,bs=16384}"
46
47 Spawn 3 reader threads doing io at priorities 0, 3, and 6. The highest
48 prio thread wants direct io, the others buffered. All want a 4kb block
49 size.
50
51 $ fio -o0 -s -b4096 "{rw=0,file=rf1,prio=6}" "{rw=0,file=rf2,prio=3}" "{rw=0,file=rf3,prio=0,direct=1}"
52
53 Examples using a job file
54 -------------------------
55
56 A sample job file doing the same as above would look like this:
57
58 [read_file]
59 rw=0
60 bs=4096
61
62 [write_file]
63 rw=1
64 bs=16384
65
66 And fio would be invoked as:
67
68 $ fio -o1 -s -f file_with_above
69
70 The second example would look like this:
71
72 [rf1]
73 rw=0
74 prio=6
75
76 [rf2]
77 rw=0
78 prio=3
79
80 [rf3]
81 rw=0
82 prio=0
83 direct=1
84
85 And fio would be invoked as:
86
87 $ fio -o0 -s -b4096 -f file_with_above
88