xref: /spdk/doc/bdevperf.md (revision b30d57cdad6d2bc75cc1e4e2ebbcebcb0d98dcfa)
1# Using bdevperf application {#bdevperf}
2
3## Introduction
4
5bdevperf is an SPDK application that is 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 much lower overhead than the fio
9plugin, resulting in much better performance for tests using a limited
10number of CPU cores.
11
12bdevperf exposes command line interface that allows to specify
13SPDK framework options as well as testing options.
14Since SPDK 20.07, bdevperf supports configuration file that is 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 is similar to FIO's config file format.
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- read
77- randread
78- write
79- randwrite
80- verify
81- reset
82- unmap
83- write_zeroes
84- flush
85- rw
86- randrw
87