xref: /spdk/doc/bdevperf.md (revision 307b8c112ffd90a26d53dd15fad67bd9038ef526)
1# bdevperf {#bdevperf}
2
3## Introduction
4
5bdevperf is an SPDK application used for performance testing
6of block devices (bdevs) exposed by the SPDK bdev layer.  It is an
7alternative to the SPDK bdev fio plugin for benchmarking SPDK bdevs.
8In some cases, bdevperf can provide lower overhead than the fio
9plugin, resulting in better performance and efficiency for tests
10using a limited number of CPU cores.
11
12bdevperf exposes command line interface that allows to specify
13SPDK framework options as well as testing options.
14bdevperf also supports a configuration file format similar
15to FIO. It allows user to create jobs parameterized by
16filename, cpumask, blocksize, queuesize, etc.
17
18## Config file
19
20bdevperf's config file format is similar to FIO.
21
22Below is an example config file that uses all available parameters:
23
24~~~{.ini}
25[global]
26filename=Malloc0:Malloc1
27bs=1024
28iosize=256
29rw=randrw
30rwmixread=90
31
32[A]
33cpumask=0xff
34
35[B]
36cpumask=[0-128]
37filename=Malloc1
38
39[global]
40filename=Malloc0
41rw=write
42
43[C]
44bs=4096
45iosize=128
46offset=1000000
47length=1000000
48~~~
49
50Jobs `[A]` `[B]` or `[C]`, inherit default values from `[global]`
51section residing above them. So in the example, job `[A]` inherits
52`filename` value and uses both `Malloc0` and `Malloc1` bdevs as targets,
53job `[B]` overrides its `filename` value and uses `Malloc1` and
54job `[C]` inherits value `Malloc0` for its `filename`.
55
56Interaction with CLI arguments is not the same as in FIO however.
57If bdevperf receives CLI argument, it overrides values
58of corresponding parameter for all `[global]` sections of config file.
59So if example config is used, specifying `-q` argument
60will make jobs `[A]` and `[B]` use its value.
61
62Below is a full list of supported parameters with descriptions.
63
64Param     | Default           | Description
65--------- | ----------------- | -----------
66filename  |                   | Bdevs to use, separated by ":"
67cpumask   | Maximum available | CPU mask. Format is defined at @ref cpu_mask
68bs        |                   | Block size (io size)
69iodepth   |                   | Queue depth
70rwmixread | `50`              | Percentage of a mixed workload that should be reads
71offset    | `0`               | Start I/O at the provided offset on the bdev
72length    | 100% of bdev size | End I/O at `offset`+`length` on the bdev
73rw        |                   | Type of I/O pattern
74
75Available rw types:
76
77- read
78- randread
79- write
80- randwrite
81- verify
82- reset
83- unmap
84- write_zeroes
85- flush
86- rw
87- randrw
88