1 .TH fio 1 "September 2007" "User Manual"
3 fio \- flexible I/O tester
6 [\fIoptions\fR] [\fIjobfile\fR]...
9 is a tool that will spawn a number of threads or processes doing a
10 particular type of I/O action as specified by the user.
11 The typical use of fio is to write a job file matching the I/O load
12 one wants to simulate.
15 .BI \-\-output \fR=\fPfilename
16 Write output to \fIfilename\fR.
18 .BI \-\-timeout \fR=\fPtimeout
19 Limit run time to \fItimeout\fR seconds.
22 Generate per-job latency logs.
25 Generate per-job bandwidth logs.
28 Print statistics in a terse, semicolon\-delimited format.
30 .BI \-\-showcmd \fR=\fPjobfile
31 Convert \fIjobfile\fR to a set of command-line options.
34 Enable read-only safety checks.
36 .BI \-\-eta \fR=\fPwhen
37 Specifies when real-time ETA estimate should be printed. \fIwhen\fR may
38 be one of `always', `never' or `auto'.
40 .BI \-\-cmdhelp \fR=\fPcommand
41 Print help information for \fIcommand\fR. May be `all' for all commands.
44 Display usage information and exit.
47 Display version information and exit.
49 Job files are in `ini' format. They consist of one or more
50 job definitions, which begin with a job name in square brackets and
51 extend to the next job name. The job name can be any ASCII string
52 except `global', which has a special meaning. Following the job name is
53 a sequence of zero or more parameters, one per line, that define the
54 behavior of the job. Any line starting with a `;' or `#' character is
55 considered a comment and ignored. See section EXAMPLES for sample
58 The global section contains default parameters for jobs specified in the
59 job file. A job is only affected by global sections residing above it,
60 and there may be any number of global sections. Specific job definitions
61 may override any parameter set in global sections.
64 Some parameters may take arguments of a specific type. The types used are:
67 String: a sequence of alphanumeric characters.
70 Integer: a whole number, possibly negative. If prefixed with `0x', the value
71 is assumed to be base 16 (hexadecimal).
74 SI integer: a whole number, possibly containing a suffix denoting the base unit
75 of the value. Accepted suffixes are `k', 'M' and 'G', denoting kilo (1024),
76 mega (1024*1024) and giga (1024*1024*1024) respectively.
79 Boolean: a true or false value. `0' denotes false, `1' denotes true.
82 Integer range: a range of integers specified in the format
83 \fIlower\fR:\fIupper\fR or \fIlower\fR-\fIupper\fR. \fIlower\fR and \fIupper\fR
84 may contain a suffix as described above. If an option allows two sets of ranges,
85 they are separated with a `,' or `/' character. For example: `8-8k/8M-4G'.
89 May be used to override the job name. On the command line, this paramter
90 has the special purpose of signalling the start of a new job.
92 .BI description \fR=\fPstr
93 Human-readable description of the job. It is printed when the job is run, but
94 otherwise has no special purpose.
96 .BI directory \fR=\fPstr
97 Prefix filenames with this directory. Used to place files in a location other
100 .BI filename \fR=\fPstr
102 normally makes up a file name based on the job name, thread number, and file
103 number. If you want to share files between threads in a job or several jobs, specify
104 a \fIfilename\fR for each of them to override the default. If the I/O engine used is
105 `net', \fIfilename\fR is the host and port to connect to in the format
106 \fIhost\fR/\fIport\fR. If the I/O engine is file-based, you can specify a number of
107 files by separating the names with a `:' character. `-' is a reserved name, meaning
108 stdin or stdout, depending on the read/write direction set.
110 .BI opendir \fR=\fPstr
111 Recursively open any files below directory \fIstr\fR.
113 .BI readwrite \fR=\fPstr "\fR,\fP rw" \fR=\fPstr
114 Type of I/O pattern. Accepted values are:
131 Mixed sequential reads and writes
134 Mixed random reads and writes
137 For mixed I/O, the default split is 50/50. For random I/O, the number of I/Os to
138 perform before getting a new offset can be specified by appending `:\fIint\fR' to
139 the pattern type. The default is 1.
142 .BI randrepeat \fR=\fPbool
143 Seed the random number generator in a predictable way so results are repeatable
146 .BI fadvise_hint \fR=\fPbool
147 Disable use of \fIposix_fadvise\fR\|(2) to advise the kernel what I/O patters are
148 likely to be issued. Default: true.
150 .BI size \fR=\fPsiint
151 Total size of I/O for this job. \fBfio\fR will run until this many bytes have
152 been transfered, unless limited by other options (\fBruntime\fR, for instance).
153 Unless \fBnr_files\fR and \fBfilesize\fR options are given, this amount will be
154 divided between the available files for the job.
156 .BI filesize \fR=\fPirange
157 Individual file sizes. May be a range, in which case \fBfio\fR will select sizes
158 for files at random within the given range, limited to \fBsize\fR in total (if that
159 is given). If \fBfilesize\fR is not specified, each created file is the same size.
161 .BI blocksize \fR=\fPsiint "\fR,\fB bs" \fR=\fPsiint
162 Block size for I/O units. Default: 4k. Values for reads and writes can be
163 specified seperately in the format \fIread\fR,\fIwrite\fR, either of
164 which may be empty to leave that value at its default.
166 .BI blocksize_range \fR=\fPirange "\fR,\fB bsrange" \fR=\fPirange
167 Specify a range of I/O block sizes. The issued I/O unit will always be a multiple
168 of the minimum size, unless \fBblocksize_unaligned\fR is set. Applied to both reads
169 and writes, but can be specified seperately (see \fBblocksize\fR).
171 .B blocksize_unaligned\fR,\fP bs_unaligned
172 If set, any size in \fBblocksize_range\fR may be used. This typically won't work
173 with direct I/O, as that normally requires sector alignment.
176 Initialise buffers with all zeros. Default: fill buffers with random data.
178 .BI nrfiles \fR=\fPint
179 Number of files to use for this job. Default: 1.
181 .BI openfiles \fR=\fPint
182 Number of files to keep open at the same time. Default: \fBnrfiles\fR.
184 .BI file_service_type \fR=\fPstr
185 Defines how files to service are selected. The following types are defined:
190 Choose a file at random
193 Round robin over open files (default).
196 The number of I/Os to issue before switching a new file can be specified by
197 appending `:\fIint\fR' to the service type.
200 .BI ioengine \fR=\fPstr
201 Defines how the job issues I/O. The following types are defined:
206 Basic \fIread\fR\|(2) or \fIwrite\fR\|(2) I/O. \fIfseek\fR\|(2) is used to
207 position the I/O location.
210 Linux native asynchronous I/O.
213 glibc POSIX asynchronous I/O using \fIaio_read\fR\|(3) and \fIaio_write\fR\|(3).
216 File is memory mapped with \fImmap\fR\|(2) and data coped using \fImemcpy\fR\|(3).
219 \fIsplice\fR\|(2) is used to transfer the data and \fIvmsplice\fR\|(2) to transfer
220 data from user-space to the kernel.
223 Use the syslet system calls to make regular read/write asynchronous.
226 SCSI generic sg v3 I/O. May be either synchronous using the SG_IO ioctl, or if
227 the target is an sg character device, we use \fIread\fR\|(2) and \fIwrite\fR\|(2)
228 for asynchronous I/O.
231 Doesn't transfer any data, just pretends to. Mainly used to exercise \fBfio\fR
232 itself and for debugging and testing purposes.
235 Transfer over the network. \fBfilename\fR must be set appropriately to
236 `\fIhost\fR/\fIport\fR' regardless of data direction. If receiving, only the
237 \fIport\fR argument is used.
240 Like \fBnet\fR, but uses \fIsplice\fR\|(2) and \fIvmsplice\fR\|(2) to map data
244 Doesn't transfer any data, but burns CPU cycles according to \fBcpuload\fR and
245 \fBcpucycles\fR parameters.
248 The GUASI I/O engine is the Generic Userspace Asynchronous Syscall Interface
249 approach to asycnronous I/O.
251 See <http://www.xmailserver.org/guasi-lib.html>.
254 Loads an external I/O engine object file. Append the engine filename as
259 .BI iodepth \fR=\fPint
260 Number of I/O units to keep in flight against the file. Default: 1.
262 .BI iodepth_batch \fR=\fPint
263 Number of I/Os to submit at once. Default: \fBiodepth\fR.
265 .BI iodepth_low \fR=\fPint
266 Low watermark indicating when to start filling the queue again. Default:
269 .BI direct \fR=\fPbool
270 If true, use non-buffered I/O (usually O_DIRECT). Default: false.
272 .BI buffered \fR=\fPbool
273 If true, use buffered I/O. This is the opposite of the \fBdirect\fR parameter.
276 .BI offset \fR=\fPsiint
277 Offset in the file to start I/O. Data before the offset will not be touched.
280 How many I/Os to perform before issuing an \fBfsync\fR\|(2) of dirty data. If 0, don't
283 .BI overwrite \fR=\fPbool
284 If writing, setup the file first and do overwrites.
286 .BI end_fsync \fR=\fPbool
287 If true, sync file contents when job exits.
289 .BI fsync_on_close \fR=\fPbool
290 If true, sync file contents on close. This differs from \fBend_fsync\fR in that
291 it will happen on every close, not just at the end of the job.
293 .BI rwmixcycle \fR=\fPint
294 How many milliseconds before switching between reads and writes for a mixed
295 workload. Default: 500ms.
297 .BI rwmixread \fR=\fPint
298 Percentage of a mixed workload that should be reads. Default: 50.
300 .BI rwmixwrite \fR=\fPint
301 Percentage of a mixed workload that would be writes. If \fBrwmixread\fR and
302 \fBwrmixwrite\fR are given and do not sum to 100%, the latter of the two
306 Normally \fBfio\fR will cover every block of the file when doing random I/O. If
307 this parameter is given, a new offset will be chosen without looking at past
308 I/O history. This parameter is mutually exclusive with \fBverify\fR.
311 Run job with given nice value. See \fInice\fR\|(2).
314 Set I/O priority value of this job between 0 (highest) and 7 (lowest). See
317 .BI prioclass \fR=\fPint
318 Set I/O priority class. See \fIionice\fR\|(1).
320 .BI thinktime \fR=\fPint
321 Stall job for given number of microseconds between issuing I/Os.
323 .BI thinktime_spin \fR=\fPint
324 Pretend to spend CPU time for given number of microseconds, sleeping the rest
325 of the time specified by \fBthinktime\fR. Only valid if \fBthinktime\fR is set.
327 .BI thinktime_blocks \fR=\fPint
328 Number of blocks to issue before waiting \fBthinktime\fR microseconds.
332 Cap bandwidth used by this job to this number of KiB/s.
334 .BI ratemin \fR=\fPint
335 Tell \fBfio\fR to do whatever it can to maintain at least the given bandwidth.
336 Failing to meet this requirement will cause the job to exit.
338 .BI rate_iops \fR=\fPint
339 Cap the bandwidth to this number of IOPS. If \fBblocksize\fR is a range, the
340 smallest block size is used as the metric.
342 .BI rate_iops_min \fR=\fPint
343 If this rate of I/O is not met, the job will exit.
345 .BI ratecycle \fR=\fPint
346 Average bandwidth for \fBrate\fR and \fBratemin\fR over this number of
347 milliseconds. Default: 1000ms.
349 .BI cpumask \fR=\fPint
350 Set CPU affinity for this job. \fIint\fR is a bitmask of allowed CPUs the job
351 may run on. See \fBsched_setaffinity\fR\|(2).
353 .BI cpus_allowed \fR=\fPstr
354 Same as \fBcpumask\fR, but allows a comma-delimited list of CPU numbers.
356 .BI startdelay \fR=\fPint
357 Delay start of job for the specified number of seconds.
359 .BI runtime \fR=\fPint
360 Terminate processing after the specified number of seconds.
363 If given, run for the specified \fBruntime\fR duration even if the files are
364 completely read or written. The same workload will be repeated as many times
365 as \fBruntime\fR allows.
367 .BI invalidate \fR=\fPbool
368 Invalidate buffer-cache for the file prior to starting I/O. Default: true.
371 Use synchronous I/O for buffered writes. For the majority of I/O engines,
372 this means using O_SYNC.
374 .BI iomem \fR=\fPstr "\fR,\fP mem" \fR=\fPstr
375 Allocation method for I/O unit buffer. Allowed values are:
380 Allocate memory with \fImalloc\fR\|(3).
383 Use shared memory buffers allocated through \fIshmget\fR\|(2).
386 Same as \fBshm\fR, but use huge pages as backing.
389 Use \fImmap\fR\|(2) for allocation. Uses anonymous memory unless a filename
390 is given after the option in the format `:\fIfile\fR'.
393 Same as \fBmmap\fR, but use huge files as backing.
396 The amount of memory allocated is the maximum allowed \fBblocksize\fR for the
397 job multiplied by \fBiodepth\fR. For \fBshmhuge\fR or \fBmmaphuge\fR to work,
398 the system must have free huge pages allocated. \fBmmaphuge\fR also needs to
399 have hugetlbfs mounted, and \fIfile\fR must point there.
402 .BI hugepage-size \fR=\fPsiint
403 Defines the size of a huge page. Must be at least equal to the system setting.
404 Should be a multiple of 1MiB. Default: 4MiB.
407 Terminate all jobs when one finishes. Default: wait for each job to finish.
409 .BI bwavgtime \fR=\fPint
410 Average bandwidth calculations over the given time in milliseconds. Default:
413 .BI create_serialize \fR=\fPbool
414 If true, serialize file creation for the jobs.
416 .BI create_fsync \fR=\fPbool
417 \fIfsync\fR\|(2) data file after creation. Default: true.
419 .BI unlink \fR=\fPbool
420 Unlink job files when done. Default: false.
423 Specifies the number of iterations (runs of the same workload) of this job.
426 .BI do_verify \fR=\fPbool
427 Run the verify phase after a write phase. Only valid if \fBverify\fR is set.
430 .BI verify \fR=\fPstr
431 Method of verifying file contents after each iteration of the job. Allowed
436 .B md5 crc16 crc32 crc64 crc7 sha256 sha512
437 Store appropriate checksum in the header of each block.
440 Write extra information about each I/O (timestamp, block number, etc.). The
441 block number is verified.
444 Fill I/O buffers with a specific pattern that is used to verify. The pattern is
445 specified by appending `:\fIint\fR' to the parameter. \fIint\fR cannot be larger
449 Pretend to verify. Used for testing internals.
453 .BI verify_sort \fR=\fPbool
454 If true, written verify blocks are sorted if \fBfio\fR deems it to be faster to
455 read them back in a sorted manner. Default: true.
457 .BI verify_offset \fR=\fPsiint
458 Swap the verification header with data somewhere else in the block before
459 writing. It it swapped back before verifying.
461 .BI verify_interval \fR=\fPsiint
462 Write the verification header for this number of bytes, which should divide
463 \fBblocksize\fR. Default: \fBblocksize\fR.
465 .BI verify_fatal \fR=\fPbool
466 If true, exit the job on the first observed verification failure. Default:
470 Wait for precedding jobs in the job file to exit before starting this one.
471 \fBstonewall\fR implies \fBnew_group\fR.
474 Start a new reporting group. If not given, all jobs in a file will be part
475 of the same reporting group, unless separated by a stonewall.
477 .BI numjobs \fR=\fPint
478 Number of clones (processes/threads performing the same workload) of this job.
482 If set, display per-group reports instead of per-job when \fBnumjobs\fR is
486 Use threads created with \fBpthread_create\fR\|(3) instead of processes created
487 with \fBfork\fR\|(2).
489 .BI zonesize \fR=\fPsiint
490 Divide file into zones of the specified size in bytes. See \fBzoneskip\fR.
492 .BI zoneskip \fR=\fPsiint
493 Skip the specified number of bytes when \fBzonesize\fR bytes of data has been
496 .BI write_iolog \fR=\fPstr
497 Write the issued I/O patterns to the specified file.
499 .BI read_iolog \fR=\fPstr
500 Replay the I/O patterns contained in the specified file generated by
501 \fBwrite_iolog\fR, or may be a \fBblktrace\fR binary file.
504 If given, write bandwidth logs of the jobs in this file.
507 Same as \fBwrite_bw_log\fR, but writes I/O completion latencies.
509 .BI lockmem \fR=\fPsiint
510 Pin the specified amount of memory with \fBmlock\fR\|(2). Can be used to
511 simulate a smaller amount of memory.
513 .BI exec_prerun \fR=\fPstr
514 Before running the job, execute the specified command with \fBsystem\fR\|(3).
516 .BI exec_postrun \fR=\fPstr
517 Same as \fBexec_prerun\fR, but the command is executed after the job completes.
519 .BI ioscheduler \fR=\fPstr
520 Attempt to switch the device hosting the file to the specified I/O scheduler.
522 .BI cpuload \fR=\fPint
523 If the job is a CPU cycle-eater, attempt to use the specified percentage of
526 .BI cpuchunks \fR=\fPint
527 If the job is a CPU cycle-eater, split the load into cycles of the
528 given time in milliseconds.
530 .BI disk_util \fR=\fPbool
531 Generate disk utilization statistics if the platform supports it. Default: true.
533 While running, \fBfio\fR will display the status of the created jobs. For example:
535 Threads: 1: [_r] [24.8% done] [ 13509/ 8334 kb/s] [eta 00h:01m:31s]
538 The characters in the first set of brackets denote the current status of each threads.
539 The possible values are:
544 Setup but not started.
550 Initialized, waiting.
553 Running, doing sequential reads.
556 Running, doing random reads.
559 Running, doing sequential writes.
562 Running, doing random writes.
565 Running, doing mixed sequential reads/writes.
568 Running, doing mixed random reads/writes.
571 Running, currently waiting for \fBfsync\fR\|(2).
574 Running, verifying written data.
577 Exited, not reaped by main thread.
580 Exited, thread reaped.
584 The second set of brackets shows the estimated completion percentage of
585 the current group. The third set shows the read and write I/O rate,
586 respectively. Finally, the estimated run time of the job is displayed.
588 When \fBfio\fR completes (or is interrupted by Ctrl-C), it will show data
589 for each thread, each group of threads, and each disk, in that order.
591 Per-thread statistics first show the threads client number, group-id, and
592 error code. The remaining figures are as follows:
597 Number of megabytes of I/O performed.
600 Average data rate (bandwidth).
606 Submission latency minimum, maximum, average and standard deviation. This is
607 the time it took to submit the I/O.
610 Completion latency minimum, maximum, average and standard deviation. This
611 is the time between submission and completion.
614 Bandwidth minimum, maximum, percentage of aggregate bandwidth received, average
615 and standard deviation.
618 CPU usage statistics. Includes user and system time, number of context switches
619 this thread went through and number of major and minor page faults.
622 Distribution of I/O depths. Each depth includes everything less than (or equal)
623 to it, but greater than the previous depth.
626 Number of read/write requests issued, and number of short read/write requests.
629 Distribution of I/O completion latencies. The numbers follow the same pattern
634 The group statistics show:
639 Number of megabytes I/O performed.
642 Aggregate bandwidth of threads in the group.
645 Minimum average bandwidth a thread saw.
648 Maximum average bandwidth a thread saw.
651 Smallest runtime of threads in the group.
654 Longest runtime of threads in the group.
658 Finally, disk statistics are printed with reads first:
663 Number of I/Os performed by all groups.
666 Number of merges in the I/O scheduler.
669 Number of ticks we kept the disk busy.
672 Total time spent in the disk queue.
679 If the \fB\-\-minimal\fR option is given, the results will be printed in a
680 semicolon-delimited format suitable for scripted use. The fields are:
683 .B jobname, groupid, error
687 .B KiB I/O, bandwidth \fR(KiB/s)\fP, runtime \fR(ms)\fP
691 .B min, max, mean, standard deviation
695 .B min, max, mean, standard deviation
699 .B min, max, aggregate percentage of total, mean, standard deviation
705 .B KiB I/O, bandwidth \fR(KiB/s)\fP, runtime \fR(ms)\fP
709 .B min, max, mean, standard deviation
713 .B min, max, mean, standard deviation
717 .B min, max, aggregate percentage of total, mean, standard deviation
723 .B user, system, context switches
726 IO depth distribution:
728 .B <=1, 2, 4, 8, 16, 32, >=64
731 IO latency distribution (ms):
733 .B <=2, 4, 10, 20, 50, 100, 250, 500, 750, 1000, >=2000
740 was written by Jens Axboe <jens.axboe@oracle.com>.
742 written by Aaron Carroll <aaronc@cse.unsw.edu.au> based
743 on documentation by Jens Axboe.
745 Report bugs to the \fBfio\fR mailing list <fio-devel@kernel.dk>. See \fBREADME\fR.
747 Further documentation is available in \fBfio\fR's \fBHOWTO\fR and \fBREADME\fR.
748 Sample jobfiles are available in \fBfio\fR's \fBexamples/\fR directory.