fio 参数设置大全

本文详细介绍了fio工具的各种参数设置,包括I/O调度器、块大小、工作模式、缓存策略等,旨在帮助用户优化存储系统的性能测试。
摘要由CSDN通过智能技术生成
NAME

       fio - flexible I/O tester

SYNOPSIS

       fio [options] [jobfile]...

DESCRIPTION

       fio  is a tool that will spawn a number of threads or processes doing a
       particular type of I/O action as specified by the  user.   The  typical
       use  of  fio  is to write a job file matching the I/O load one wants to
       simulate.

OPTIONS

       --output=filename
              Write output to filename.

       --timeout=timeout
              Limit run time to timeout seconds.

       --latency-log
              Generate per-job latency logs.

       --bandwidth-log
              Generate per-job bandwidth logs.

       --minimal
              Print statistics in a terse, semicolon-delimited format.

       --showcmd=jobfile
              Convert jobfile to a set of command-line options.

       --readonly
              Enable read-only safety checks.

       --eta=when
              Specifies when real-time ETA estimate should be  printed.   when
              may be one of `always', `never' or `auto'.

       --section=sec
              Only run section sec from job file.

       --cmdhelp=command
              Print  help  information  for  command.   May  be  `all' for all
              commands.

       --debug=type
              Enable verbose tracing of various fio actions. May be `all'  for
              all   types  or  individual  types  separated  by  a  comma  (eg
              --debug=io,file).  `help'  will  list  all   available   tracing
              options.

       --help Display usage information and exit.

       --version
              Display version information and exit.

       --terse-version=type
              Terse version output format

JOB FILE FORMAT

       Job  files  are  in  `ini'  format.  They  consist  of  one or more job
       definitions, which begin with a job name in square brackets and  extend
       to  the  next  job  name.   The job name can be any ASCII string except
       `global', which has a special meaning.  Following the  job  name  is  a
       sequence  of  zero  or  more  parameters, one per line, that define the
       behavior of the job.  Any line starting with a `;' or `#' character  is
       considered a comment and ignored.

       If jobfile is specified as `-', the job file will be read from standard
       input.

   Global Section
       The global section contains default parameters for  jobs  specified  in
       the job file.  A job is only affected by global sections residing above
       it, and there may be any  number  of  global  sections.   Specific  job
       definitions may override any parameter set in global sections.

JOB PARAMETERS

   Types
       Some  parameters may take arguments of a specific type.  The types used
       are:

       str    String: a sequence of alphanumeric characters.

       int    SI  integer:  a  whole  number,  possibly  containing  a  suffix
              denoting the base unit of the value.  Accepted suffixes are `k',
              'M', 'G', 'T', and 'P', denoting  kilo  (1024),  mega  (1024^2),
              giga  (1024^3),  tera  (1024^4), and peta (1024^5) respectively.
              The suffix is not case sensitive. If  prefixed  with  '0x',  the
              value  is  assumed  to  be  base  16 (hexadecimal). A suffix may
              include a trailing 'b', for instance 'kb' is identical  to  'k'.
              You  can  specify  a base 10 value by using 'KiB', 'MiB', 'GiB',
              etc. This is useful for disk drives where values are often given
              in  base  10  values.  Specifying '30GiB' will get you 30*1000^3
              bytes.

       bool   Boolean: a true or false value. `0' denotes false,  `1'  denotes
              true.

       irange Integer  range:  a  range  of  integers  specified in the format
              lower:upper or lower-upper. lower and upper may contain a suffix
              as  described  above.   If  an option allows two sets of ranges,
              they are separated with a `,' or  `/'  character.  For  example:
              `8-8k/8M-4G'.

       float_list
              List  of floating numbers: A list of floating numbers, separated
              by a ':' charcater.

   Parameter List
       name=str
              May be used to override the job name.  On the command line, this
              parameter  has  the special purpose of signalling the start of a
              new job.

       description=str
              Human-readable description of the job. It is  printed  when  the
              job is run, but otherwise has no special purpose.

       directory=str
              Prefix  filenames with this directory.  Used to place files in a
              location other than `./'.

       filename=str
              fio normally makes up a file name based on the job name,  thread
              number,  and  file  number.  If  you want to share files between
              threads in a job or several jobs, specify a filename for each of
              them  to  override the default. If the I/O engine used is `net',
              filename is the host and  port  to  connect  to  in  the  format
              host/port.  If  the  I/O engine is file-based, you can specify a
              number of files by separating the names with  a  `:'  character.
              `-'  is  a  reserved name, meaning stdin or stdout, depending on
              the read/write direction set.

       lockfile=str
              Fio defaults to not locking any files before it does IO to them.
              If  a file or file descriptor is shared, fio can serialize IO to
              that file to make the end result consistent. This is  usual  for
              emulating real workloads that share files.  The lock modes are:

                     none   No locking. This is the default.

                     exclusive
                            Only  one thread or process may do IO at the time,
                            excluding all others.

                     readwrite
                            Read-write locking on the file. Many  readers  may
                            access  the  file at the same time, but writes get
                            exclusive access.

              The option may be post-fixed with a lock batch number.  If  set,
              then  each  thread/process may do that amount of IOs to the file
              before giving up the lock.  Since lock acquisition is expensive,
              batching the lock/unlocks will speed up IO.

       opendir=str Recursively open any files below directory str.

       readwrite=str, rw=str
              Type of I/O pattern.  Accepted values are:

                     read   Sequential reads.

                     write  Sequential writes.

                     randread
                            Random reads.

                     randwrite
                            Random writes.

                     rw     Mixed sequential reads and writes.

                     randrw Mixed random reads and writes.

              For  mixed I/O, the default split is 50/50. For certain types of
              io the result may still be skewed a bit, since the speed may  be
              different.  It  is  possible  to  specify a number of IO's to do
              before getting a new offset, this is one by appending  a  `:<nr>
              to the end of the string given. For a random read, it would look
              like rw=randread:8 for passing in  an  offset  modifier  with  a
              value of 8. If the postfix is used with a sequential IO pattern,
              then the value specified will be added to the  generated  offset
              for  each  IO.  For instance, using rw=write:4k will skip 4k for
              every write. It turns sequential  IO  into  sequential  IO  with
              holes. See the rw_sequencer option.

       rw_sequencer=str
              If  an  offset  modifier  is  given by appending a number to the
              rw=<str>  line,  then  this  option  controls  how  that  number
              modifies the IO offset being generated. Accepted values are:

                     sequential
                            Generate sequential offset

                     identical
                            Generate the same offset

              sequential  is  only  useful  for  random  IO,  where  fio would
              normally generate a new random  offset  for  every  IO.  If  you
              append  eg  8 to randread, you would get a new random offset for
              every 8 IO's. The result would be a seek for only every 8  IO's,
              instead  of  for every IO. Use rw=randread:8 to specify that. As
              sequential IO is already sequential, setting sequential for that
              would  not  result  in  any differences.  identical behaves in a
              similar fashion, except it sends the same  offset  8  number  of
              times before generating a new offset.

       kb_base=int
              The  base  unit  for a kilobyte. The defacto base is 2^10, 1024.
              Storage manufacturers like to use 10^3 or 1000  as  a  base  ten
              unit  instead,  for  obvious  reasons.  Allow values are 1024 or
              1000, with 1024 being the default.

       randrepeat=bool
              Seed the random number generator in a predictable way so results
              are repeatable across runs.  Default: true.

       use_os_rand=bool
              Fio  can  either  use the random generator supplied by the OS to
              generator random offsets,  or  it  can  use  it's  own  internal
              generator (based on Tausworthe).  Default is to use the internal
              generator, which is often of better quality and faster. Default:
              false.

       fallocate=str
              Whether  pre-allocation  is  performed  when  laying down files.
              Accepted values are:

                     none   Do not pre-allocate space.

                     posix  Pre-allocate v
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值