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.
57 If \fIjobfile\fR is specified as `-', the job file will be read from
60 The global section contains default parameters for jobs specified in the
61 job file. A job is only affected by global sections residing above it,
62 and there may be any number of global sections. Specific job definitions
63 may override any parameter set in global sections.
66 Some parameters may take arguments of a specific type. The types used are:
69 String: a sequence of alphanumeric characters.
72 Integer: a whole number, possibly negative. If prefixed with `0x', the value
73 is assumed to be base 16 (hexadecimal).
76 SI integer: a whole number, possibly containing a suffix denoting the base unit
77 of the value. Accepted suffixes are `k', 'M' and 'G', denoting kilo (1024),
78 mega (1024*1024) and giga (1024*1024*1024) respectively.
81 Boolean: a true or false value. `0' denotes false, `1' denotes true.
84 Integer range: a range of integers specified in the format
85 \fIlower\fR:\fIupper\fR or \fIlower\fR\-\fIupper\fR. \fIlower\fR and
86 \fIupper\fR may contain a suffix as described above. If an option allows two
87 sets of ranges, they are separated with a `,' or `/' character. For example:
92 May be used to override the job name. On the command line, this parameter
93 has the special purpose of signalling the start of a new job.
95 .BI description \fR=\fPstr
96 Human-readable description of the job. It is printed when the job is run, but
97 otherwise has no special purpose.
99 .BI directory \fR=\fPstr
100 Prefix filenames with this directory. Used to place files in a location other
103 .BI filename \fR=\fPstr
105 normally makes up a file name based on the job name, thread number, and file
106 number. If you want to share files between threads in a job or several jobs,
107 specify a \fIfilename\fR for each of them to override the default. If the I/O
108 engine used is `net', \fIfilename\fR is the host and port to connect to in the
109 format \fIhost\fR/\fIport\fR. If the I/O engine is file-based, you can specify
110 a number of files by separating the names with a `:' character. `\-' is a
111 reserved name, meaning stdin or stdout, depending on the read/write direction
114 .BI opendir \fR=\fPstr
115 Recursively open any files below directory \fIstr\fR.
117 .BI readwrite \fR=\fPstr "\fR,\fP rw" \fR=\fPstr
118 Type of I/O pattern. Accepted values are:
135 Mixed sequential reads and writes.
138 Mixed random reads and writes.
141 For mixed I/O, the default split is 50/50. For random I/O, the number of I/Os
142 to perform before getting a new offset can be specified by appending
143 `:\fIint\fR' to the pattern type. The default is 1.
146 .BI randrepeat \fR=\fPbool
147 Seed the random number generator in a predictable way so results are repeatable
148 across runs. Default: true.
150 .BI fadvise_hint \fR=\fPbool
151 Disable use of \fIposix_fadvise\fR\|(2) to advise the kernel what I/O patterns
152 are likely to be issued. Default: true.
154 .BI size \fR=\fPsiint
155 Total size of I/O for this job. \fBfio\fR will run until this many bytes have
156 been transfered, unless limited by other options (\fBruntime\fR, for instance).
157 Unless \fBnr_files\fR and \fBfilesize\fR options are given, this amount will be
158 divided between the available files for the job.
160 .BI filesize \fR=\fPirange
161 Individual file sizes. May be a range, in which case \fBfio\fR will select sizes
162 for files at random within the given range, limited to \fBsize\fR in total (if
163 that is given). If \fBfilesize\fR is not specified, each created file is the
166 .BI blocksize \fR=\fPsiint "\fR,\fB bs" \fR=\fPsiint
167 Block size for I/O units. Default: 4k. Values for reads and writes can be
168 specified seperately in the format \fIread\fR,\fIwrite\fR, either of
169 which may be empty to leave that value at its default.
171 .BI blocksize_range \fR=\fPirange "\fR,\fB bsrange" \fR=\fPirange
172 Specify a range of I/O block sizes. The issued I/O unit will always be a
173 multiple of the minimum size, unless \fBblocksize_unaligned\fR is set. Applies
174 to both reads and writes, but can be specified seperately (see \fBblocksize\fR).
176 .B blocksize_unaligned\fR,\fP bs_unaligned
177 If set, any size in \fBblocksize_range\fR may be used. This typically won't
178 work with direct I/O, as that normally requires sector alignment.
181 Initialise buffers with all zeros. Default: fill buffers with random data.
183 .BI nrfiles \fR=\fPint
184 Number of files to use for this job. Default: 1.
186 .BI openfiles \fR=\fPint
187 Number of files to keep open at the same time. Default: \fBnrfiles\fR.
189 .BI file_service_type \fR=\fPstr
190 Defines how files to service are selected. The following types are defined:
195 Choose a file at random
198 Round robin over open files (default).
201 The number of I/Os to issue before switching a new file can be specified by
202 appending `:\fIint\fR' to the service type.
205 .BI ioengine \fR=\fPstr
206 Defines how the job issues I/O. The following types are defined:
211 Basic \fIread\fR\|(2) or \fIwrite\fR\|(2) I/O. \fIfseek\fR\|(2) is used to
212 position the I/O location.
215 Basic \fIpread\fR\|(2) or \fIpwrite\fR\|(2) I/O.
218 Linux native asynchronous I/O.
221 glibc POSIX asynchronous I/O using \fIaio_read\fR\|(3) and \fIaio_write\fR\|(3).
224 File is memory mapped with \fImmap\fR\|(2) and data copied using
228 \fIsplice\fR\|(2) is used to transfer the data and \fIvmsplice\fR\|(2) to
229 transfer data from user-space to the kernel.
232 Use the syslet system calls to make regular read/write asynchronous.
235 SCSI generic sg v3 I/O. May be either synchronous using the SG_IO ioctl, or if
236 the target is an sg character device, we use \fIread\fR\|(2) and
237 \fIwrite\fR\|(2) for asynchronous I/O.
240 Doesn't transfer any data, just pretends to. Mainly used to exercise \fBfio\fR
241 itself and for debugging and testing purposes.
244 Transfer over the network. \fBfilename\fR must be set appropriately to
245 `\fIhost\fR/\fIport\fR' regardless of data direction. If receiving, only the
246 \fIport\fR argument is used.
249 Like \fBnet\fR, but uses \fIsplice\fR\|(2) and \fIvmsplice\fR\|(2) to map data
253 Doesn't transfer any data, but burns CPU cycles according to \fBcpuload\fR and
254 \fBcpucycles\fR parameters.
257 The GUASI I/O engine is the Generic Userspace Asynchronous Syscall Interface
258 approach to asycnronous I/O.
260 See <http://www.xmailserver.org/guasi\-lib.html>.
263 Loads an external I/O engine object file. Append the engine filename as
268 .BI iodepth \fR=\fPint
269 Number of I/O units to keep in flight against the file. Default: 1.
271 .BI iodepth_batch \fR=\fPint
272 Number of I/Os to submit at once. Default: \fBiodepth\fR.
274 .BI iodepth_low \fR=\fPint
275 Low watermark indicating when to start filling the queue again. Default:
278 .BI direct \fR=\fPbool
279 If true, use non-buffered I/O (usually O_DIRECT). Default: false.
281 .BI buffered \fR=\fPbool
282 If true, use buffered I/O. This is the opposite of the \fBdirect\fR parameter.
285 .BI offset \fR=\fPsiint
286 Offset in the file to start I/O. Data before the offset will not be touched.
289 How many I/Os to perform before issuing an \fBfsync\fR\|(2) of dirty data. If
290 0, don't sync. Default: 0.
292 .BI overwrite \fR=\fPbool
293 If writing, setup the file first and do overwrites. Default: false.
295 .BI end_fsync \fR=\fPbool
296 Sync file contents when job exits. Default: false.
298 .BI fsync_on_close \fR=\fPbool
299 If true, sync file contents on close. This differs from \fBend_fsync\fR in that
300 it will happen on every close, not just at the end of the job. Default: false.
302 .BI rwmixcycle \fR=\fPint
303 How many milliseconds before switching between reads and writes for a mixed
304 workload. Default: 500ms.
306 .BI rwmixread \fR=\fPint
307 Percentage of a mixed workload that should be reads. Default: 50.
309 .BI rwmixwrite \fR=\fPint
310 Percentage of a mixed workload that should be writes. If \fBrwmixread\fR and
311 \fBwrmixwrite\fR are given and do not sum to 100%, the latter of the two
312 overrides the first. Default: 50.
315 Normally \fBfio\fR will cover every block of the file when doing random I/O. If
316 this parameter is given, a new offset will be chosen without looking at past
317 I/O history. This parameter is mutually exclusive with \fBverify\fR.
320 Run job with given nice value. See \fInice\fR\|(2).
323 Set I/O priority value of this job between 0 (highest) and 7 (lowest). See
326 .BI prioclass \fR=\fPint
327 Set I/O priority class. See \fIionice\fR\|(1).
329 .BI thinktime \fR=\fPint
330 Stall job for given number of microseconds between issuing I/Os.
332 .BI thinktime_spin \fR=\fPint
333 Pretend to spend CPU time for given number of microseconds, sleeping the rest
334 of the time specified by \fBthinktime\fR. Only valid if \fBthinktime\fR is set.
336 .BI thinktime_blocks \fR=\fPint
337 Number of blocks to issue before waiting \fBthinktime\fR microseconds.
341 Cap bandwidth used by this job to this number of KiB/s.
343 .BI ratemin \fR=\fPint
344 Tell \fBfio\fR to do whatever it can to maintain at least the given bandwidth.
345 Failing to meet this requirement will cause the job to exit.
347 .BI rate_iops \fR=\fPint
348 Cap the bandwidth to this number of IOPS. If \fBblocksize\fR is a range, the
349 smallest block size is used as the metric.
351 .BI rate_iops_min \fR=\fPint
352 If this rate of I/O is not met, the job will exit.
354 .BI ratecycle \fR=\fPint
355 Average bandwidth for \fBrate\fR and \fBratemin\fR over this number of
356 milliseconds. Default: 1000ms.
358 .BI cpumask \fR=\fPint
359 Set CPU affinity for this job. \fIint\fR is a bitmask of allowed CPUs the job
360 may run on. See \fBsched_setaffinity\fR\|(2).
362 .BI cpus_allowed \fR=\fPstr
363 Same as \fBcpumask\fR, but allows a comma-delimited list of CPU numbers.
365 .BI startdelay \fR=\fPint
366 Delay start of job for the specified number of seconds.
368 .BI runtime \fR=\fPint
369 Terminate processing after the specified number of seconds.
372 If given, run for the specified \fBruntime\fR duration even if the files are
373 completely read or written. The same workload will be repeated as many times
374 as \fBruntime\fR allows.
376 .BI invalidate \fR=\fPbool
377 Invalidate buffer-cache for the file prior to starting I/O. Default: true.
380 Use synchronous I/O for buffered writes. For the majority of I/O engines,
381 this means using O_SYNC. Default: false.
383 .BI iomem \fR=\fPstr "\fR,\fP mem" \fR=\fPstr
384 Allocation method for I/O unit buffer. Allowed values are:
389 Allocate memory with \fImalloc\fR\|(3).
392 Use shared memory buffers allocated through \fIshmget\fR\|(2).
395 Same as \fBshm\fR, but use huge pages as backing.
398 Use \fImmap\fR\|(2) for allocation. Uses anonymous memory unless a filename
399 is given after the option in the format `:\fIfile\fR'.
402 Same as \fBmmap\fR, but use huge files as backing.
405 The amount of memory allocated is the maximum allowed \fBblocksize\fR for the
406 job multiplied by \fBiodepth\fR. For \fBshmhuge\fR or \fBmmaphuge\fR to work,
407 the system must have free huge pages allocated. \fBmmaphuge\fR also needs to
408 have hugetlbfs mounted, and \fIfile\fR must point there.
411 .BI hugepage\-size \fR=\fPsiint
412 Defines the size of a huge page. Must be at least equal to the system setting.
413 Should be a multiple of 1MiB. Default: 4MiB.
416 Terminate all jobs when one finishes. Default: wait for each job to finish.
418 .BI bwavgtime \fR=\fPint
419 Average bandwidth calculations over the given time in milliseconds. Default:
422 .BI create_serialize \fR=\fPbool
423 If true, serialize file creation for the jobs. Default: true.
425 .BI create_fsync \fR=\fPbool
426 \fIfsync\fR\|(2) data file after creation. Default: true.
428 .BI unlink \fR=\fPbool
429 Unlink job files when done. Default: false.
432 Specifies the number of iterations (runs of the same workload) of this job.
435 .BI do_verify \fR=\fPbool
436 Run the verify phase after a write phase. Only valid if \fBverify\fR is set.
439 .BI verify \fR=\fPstr
440 Method of verifying file contents after each iteration of the job. Allowed
445 .B md5 crc16 crc32 crc64 crc7 sha256 sha512
446 Store appropriate checksum in the header of each block.
449 Write extra information about each I/O (timestamp, block number, etc.). The
450 block number is verified.
453 Fill I/O buffers with a specific pattern that is used to verify. The pattern is
454 specified by appending `:\fIint\fR' to the parameter. \fIint\fR cannot be larger
458 Pretend to verify. Used for testing internals.
462 .BI verify_sort \fR=\fPbool
463 If true, written verify blocks are sorted if \fBfio\fR deems it to be faster to
464 read them back in a sorted manner. Default: true.
466 .BI verify_offset \fR=\fPsiint
467 Swap the verification header with data somewhere else in the block before
468 writing. It is swapped back before verifying.
470 .BI verify_interval \fR=\fPsiint
471 Write the verification header for this number of bytes, which should divide
472 \fBblocksize\fR. Default: \fBblocksize\fR.
474 .BI verify_fatal \fR=\fPbool
475 If true, exit the job on the first observed verification failure. Default:
479 Wait for preceeding jobs in the job file to exit before starting this one.
480 \fBstonewall\fR implies \fBnew_group\fR.
483 Start a new reporting group. If not given, all jobs in a file will be part
484 of the same reporting group, unless separated by a stonewall.
486 .BI numjobs \fR=\fPint
487 Number of clones (processes/threads performing the same workload) of this job.
491 If set, display per-group reports instead of per-job when \fBnumjobs\fR is
495 Use threads created with \fBpthread_create\fR\|(3) instead of processes created
496 with \fBfork\fR\|(2).
498 .BI zonesize \fR=\fPsiint
499 Divide file into zones of the specified size in bytes. See \fBzoneskip\fR.
501 .BI zoneskip \fR=\fPsiint
502 Skip the specified number of bytes when \fBzonesize\fR bytes of data have been
505 .BI write_iolog \fR=\fPstr
506 Write the issued I/O patterns to the specified file.
508 .BI read_iolog \fR=\fPstr
509 Replay the I/O patterns contained in the specified file generated by
510 \fBwrite_iolog\fR, or may be a \fBblktrace\fR binary file.
513 If given, write bandwidth logs of the jobs in this file.
516 Same as \fBwrite_bw_log\fR, but writes I/O completion latencies.
518 .BI lockmem \fR=\fPsiint
519 Pin the specified amount of memory with \fBmlock\fR\|(2). Can be used to
520 simulate a smaller amount of memory.
522 .BI exec_prerun \fR=\fPstr
523 Before running the job, execute the specified command with \fBsystem\fR\|(3).
525 .BI exec_postrun \fR=\fPstr
526 Same as \fBexec_prerun\fR, but the command is executed after the job completes.
528 .BI ioscheduler \fR=\fPstr
529 Attempt to switch the device hosting the file to the specified I/O scheduler.
531 .BI cpuload \fR=\fPint
532 If the job is a CPU cycle-eater, attempt to use the specified percentage of
535 .BI cpuchunks \fR=\fPint
536 If the job is a CPU cycle-eater, split the load into cycles of the
537 given time in milliseconds.
539 .BI disk_util \fR=\fPbool
540 Generate disk utilization statistics if the platform supports it. Default: true.
542 While running, \fBfio\fR will display the status of the created jobs. For
546 Threads: 1: [_r] [24.8% done] [ 13509/ 8334 kb/s] [eta 00h:01m:31s]
549 The characters in the first set of brackets denote the current status of each
550 threads. The possible values are:
556 Setup but not started.
562 Initialized, waiting.
565 Running, doing sequential reads.
568 Running, doing random reads.
571 Running, doing sequential writes.
574 Running, doing random writes.
577 Running, doing mixed sequential reads/writes.
580 Running, doing mixed random reads/writes.
583 Running, currently waiting for \fBfsync\fR\|(2).
586 Running, verifying written data.
589 Exited, not reaped by main thread.
592 Exited, thread reaped.
596 The second set of brackets shows the estimated completion percentage of
597 the current group. The third set shows the read and write I/O rate,
598 respectively. Finally, the estimated run time of the job is displayed.
600 When \fBfio\fR completes (or is interrupted by Ctrl-C), it will show data
601 for each thread, each group of threads, and each disk, in that order.
603 Per-thread statistics first show the threads client number, group-id, and
604 error code. The remaining figures are as follows:
608 Number of megabytes of I/O performed.
611 Average data rate (bandwidth).
617 Submission latency minimum, maximum, average and standard deviation. This is
618 the time it took to submit the I/O.
621 Completion latency minimum, maximum, average and standard deviation. This
622 is the time between submission and completion.
625 Bandwidth minimum, maximum, percentage of aggregate bandwidth received, average
626 and standard deviation.
629 CPU usage statistics. Includes user and system time, number of context switches
630 this thread went through and number of major and minor page faults.
633 Distribution of I/O depths. Each depth includes everything less than (or equal)
634 to it, but greater than the previous depth.
637 Number of read/write requests issued, and number of short read/write requests.
640 Distribution of I/O completion latencies. The numbers follow the same pattern
644 The group statistics show:
649 Number of megabytes I/O performed.
652 Aggregate bandwidth of threads in the group.
655 Minimum average bandwidth a thread saw.
658 Maximum average bandwidth a thread saw.
661 Shortest runtime of threads in the group.
664 Longest runtime of threads in the group.
668 Finally, disk statistics are printed with reads first:
673 Number of I/Os performed by all groups.
676 Number of merges in the I/O scheduler.
679 Number of ticks we kept the disk busy.
682 Total time spent in the disk queue.
689 If the \fB\-\-minimal\fR option is given, the results will be printed in a
690 semicolon-delimited format suitable for scripted use. The fields are:
693 .B jobname, groupid, error
697 .B KiB I/O, bandwidth \fR(KiB/s)\fP, runtime \fR(ms)\fP
701 .B min, max, mean, standard deviation
705 .B min, max, mean, standard deviation
709 .B min, max, aggregate percentage of total, mean, standard deviation
715 .B KiB I/O, bandwidth \fR(KiB/s)\fP, runtime \fR(ms)\fP
719 .B min, max, mean, standard deviation
723 .B min, max, mean, standard deviation
727 .B min, max, aggregate percentage of total, mean, standard deviation
733 .B user, system, context switches
736 IO depth distribution:
738 .B <=1, 2, 4, 8, 16, 32, >=64
741 IO latency distribution (ms):
743 .B <=2, 4, 10, 20, 50, 100, 250, 500, 750, 1000, >=2000
750 was written by Jens Axboe <jens.axboe@oracle.com>.
752 This man page was written by Aaron Carroll <aaronc@cse.unsw.edu.au> based
753 on documentation by Jens Axboe.
755 Report bugs to the \fBfio\fR mailing list <fio-devel@kernel.dk>.
758 For further documentation see \fBHOWTO\fR and \fBREADME\fR.
760 Sample jobfiles are available in the \fBexamples\fR directory.