xref: /spdk/scripts/perf/nvmf/README.md (revision 34edd9f1bf5fda4c987f4500ddc3c9f50be32e7d)
1b06212cfSKarol Latecki# Running NVMe-OF Performance Test Cases
2a42dfab1SKarol Latecki
3b06212cfSKarol LateckiScripts contained in this directory are used to run TCP and RDMA benchmark tests,
4b06212cfSKarol Lateckithat are later published at [spdk.io performance reports section](https://spdk.io/doc/performance_reports.html).
5b06212cfSKarol LateckiTo run the scripts in your environment please follow steps below.
6a42dfab1SKarol Latecki
7b06212cfSKarol Latecki## Test Systems Requirements
8a42dfab1SKarol Latecki
9b06212cfSKarol Latecki- The OS installed on test systems must be a Linux OS.
10b06212cfSKarol Latecki  Scripts were primarily used on systems with Fedora and
11b06212cfSKarol Latecki  Ubuntu 18.04/20.04 distributions.
12b06212cfSKarol Latecki- Each test system must have at least one RDMA-capable NIC installed for RDMA tests.
13b06212cfSKarol Latecki  For TCP tests any TCP-capable NIC will do. However, high-bandwidth,
14b06212cfSKarol Latecki  high-performance NICs like Intel E810 CQDA2 or Mellanox ConnectX-5 are
15b06212cfSKarol Latecki  suggested because the NVMe-oF workload is network bound.
16b06212cfSKarol Latecki  So, if you use a NIC capable of less than 100Gbps on NVMe-oF target
17b06212cfSKarol Latecki  system, you will quickly saturate your NICs.
18b06212cfSKarol Latecki- Python3 interpreter must be available on all test systems.
19b06212cfSKarol Latecki  Paramiko and Pandas modules must be installed.
20b06212cfSKarol Latecki- nvmecli package must be installed on all test systems.
21b06212cfSKarol Latecki- fio must be downloaded from [Github](https://github.com/axboe/fio) and built.
22b06212cfSKarol Latecki  This must be done on Initiator test systems to later build SPDK with
23b06212cfSKarol Latecki  "--with-fio" option.
24b06212cfSKarol Latecki- All test systems must have a user account with a common name,
25b06212cfSKarol Latecki  password and passwordless sudo enabled.
26b06212cfSKarol Latecki- [mlnx-tools](https://github.com/Mellanox/mlnx-tools) package must be downloaded
27b06212cfSKarol Latecki  to /usr/src/local directory in order to configure NIC ports IRQ affinity.
28b06212cfSKarol Latecki  If custom directory is to be used, then it must be set using irq_scripts_dir
29b06212cfSKarol Latecki  option in Target and Initiator configuration sections.
3090b95e28SKarol Latecki- `sysstat` package must be installed for SAR CPU utilization measurements.
31b9403ae5SKarol Latecki- `bwm-ng` package must be installed for NIC bandwidth utilization measurements.
32bacf7ec2SJaroslaw Chachulski- `pcm` package must be installed for pcm CPU measurements.
3393be26a5SKarol Latecki
34b06212cfSKarol Latecki### Optional
35a42dfab1SKarol Latecki
36b06212cfSKarol Latecki- For test using the Kernel Target, nvmet-cli must be downloaded and build on Target system.
37b06212cfSKarol Latecki  nvmet-cli is available [here](http://git.infradead.org/users/hch/nvmetcli.git).
3893be26a5SKarol Latecki
39b06212cfSKarol Latecki## Manual configuration
4093be26a5SKarol Latecki
41b06212cfSKarol LateckiBefore running the scripts some manual test systems configuration is required:
4293be26a5SKarol Latecki
43b06212cfSKarol Latecki- Configure IP address assignment on the NIC ports that will be used for test.
44b06212cfSKarol Latecki  Make sure to make these assignments persistent, as in some cases NIC drivers may be reloaded.
45b06212cfSKarol Latecki- Adjust firewall service to allow traffic on IP - port pairs used in test
46b06212cfSKarol Latecki  (or disable firewall service completely if possible).
47b06212cfSKarol Latecki- Adjust or completely disable local security engines like AppArmor or SELinux.
48a42dfab1SKarol Latecki
49b06212cfSKarol Latecki## JSON configuration for test run automation
5093be26a5SKarol Latecki
51b06212cfSKarol LateckiAn example json configuration file with the minimum configuration required
52b06212cfSKarol Lateckito automate NVMe-oF testing is provided in this repository.
53b06212cfSKarol LateckiThe following sub-chapters describe each configuration section in more detail.
5493be26a5SKarol Latecki
55b06212cfSKarol Latecki### General settings section
5693be26a5SKarol Latecki
57b06212cfSKarol Latecki``` ~sh
58b06212cfSKarol Latecki"general": {
59b06212cfSKarol Latecki    "username": "user",
60b06212cfSKarol Latecki    "password": "password",
61b06212cfSKarol Latecki    "transport": "transport_type",
621c7b4b7bSJaroslaw Chachulski    "skip_spdk_install": bool,
63fb3b0cb7SJaroslaw Chachulski    "irdma_roce_enable": bool,
64fb3b0cb7SJaroslaw Chachulski    "pause_frames": bool
65b06212cfSKarol Latecki}
66b06212cfSKarol Latecki```
6793be26a5SKarol Latecki
68b06212cfSKarol LateckiRequired:
6993be26a5SKarol Latecki
70b06212cfSKarol Latecki- username - username for the SSH session
71b06212cfSKarol Latecki- password - password for the SSH session
72b06212cfSKarol Latecki- transport - transport layer to be used throughout the test ("tcp" or "rdma")
7393be26a5SKarol Latecki
74b06212cfSKarol LateckiOptional:
7593be26a5SKarol Latecki
76b06212cfSKarol Latecki- skip_spdk_install - by default SPDK sources will be copied from Target
77b06212cfSKarol Latecki  to the Initiator systems each time run_nvmf.py script is run. If the SPDK
78b06212cfSKarol Latecki  is already in place on Initiator systems and there's no need to re-build it,
79b06212cfSKarol Latecki  then set this option to true.
80b06212cfSKarol Latecki  Default: false.
811c7b4b7bSJaroslaw Chachulski- irdma_roce_enable - loads irdma driver with RoCEv2 network protocol enabled on Target and
821c7b4b7bSJaroslaw Chachulski  Initiator machines. This option applies only to system with Intel E810 NICs.
831c7b4b7bSJaroslaw Chachulski  Default: false
84fb3b0cb7SJaroslaw Chachulski- pause_frames - configures pause frames when RoCEv2 network protocol is enabled on Target and
85fb3b0cb7SJaroslaw Chachulski  Initiator machines.
86fb3b0cb7SJaroslaw Chachulski  Default: false
8793be26a5SKarol Latecki
88b06212cfSKarol Latecki### Target System Configuration
8966f42f37SKarol Latecki
90b06212cfSKarol Latecki``` ~sh
91b06212cfSKarol Latecki"target": {
92b06212cfSKarol Latecki  "mode": "spdk",
93b06212cfSKarol Latecki  "nic_ips": ["192.0.1.1", "192.0.2.1"],
94b06212cfSKarol Latecki  "core_mask": "[1-10]",
95b06212cfSKarol Latecki  "null_block_devices": 8,
96b06212cfSKarol Latecki  "nvmet_bin": "/path/to/nvmetcli",
9790b95e28SKarol Latecki  "sar_settings": true,
983d9b0628SKarol Latecki  "pcm_settings": false,
99b06212cfSKarol Latecki  "enable_bandwidth": [true, 60],
1009b3f5e98SKarol Latecki  "enable_dpdk_memory": true
101b06212cfSKarol Latecki  "num_shared_buffers": 4096,
102b06212cfSKarol Latecki  "scheduler_settings": "static",
103b06212cfSKarol Latecki  "zcopy_settings": false,
104b06212cfSKarol Latecki  "dif_insert_strip": true,
10504dd0282SMichal Berger  "null_block_dif_type": 3,
106cdab715bSKarol Latecki  "pm_settings": [true, 30, 1, 60],
107cdab715bSKarol Latecki  "irq_settings": {
108cdab715bSKarol Latecki    "mode": "cpulist",
109cdab715bSKarol Latecki    "cpulist": "[0-10]",
110cdab715bSKarol Latecki    "exclude_cpulist": false
111cdab715bSKarol Latecki  }
112b06212cfSKarol Latecki}
113b06212cfSKarol Latecki```
11466f42f37SKarol Latecki
115b06212cfSKarol LateckiRequired:
11693be26a5SKarol Latecki
117b06212cfSKarol Latecki- mode - Target application mode, "spdk" or "kernel".
118b06212cfSKarol Latecki- nic_ips - IP addresses of NIC ports to be used by the target to export
119b06212cfSKarol Latecki  NVMe-oF subsystems.
120b06212cfSKarol Latecki- core_mask - Used by SPDK target only.
121b06212cfSKarol Latecki  CPU core mask either in form of actual mask (i.e. 0xAAAA) or core list
122b06212cfSKarol Latecki  (i.e. [0,1,2-5,6).
123b06212cfSKarol Latecki  At this moment the scripts cannot restrict the Kernel target to only
124b06212cfSKarol Latecki  use certain CPU cores. Important: upper bound of the range is inclusive!
12593be26a5SKarol Latecki
126b06212cfSKarol LateckiOptional, common:
12793be26a5SKarol Latecki
128b06212cfSKarol Latecki- null_block_devices - int, number of null block devices to create.
129b06212cfSKarol Latecki  Detected NVMe devices are not used if option is present. Default: 0.
13090b95e28SKarol Latecki- sar_settings - bool
13190b95e28SKarol Latecki  Enable SAR CPU utilization measurement on Target side. SAR thread will
13290b95e28SKarol Latecki  wait until fio finishes it's "ramp_time" and then start measurement for
13390b95e28SKarol Latecki  fio "run_time" duration. Default: enabled.
1343d9b0628SKarol Latecki- pcm_settings - bool
1355d82cd2bSKarol Latecki  Enable [PCM](https://github.com/opcm/pcm.git) measurements on Target side.
136bacf7ec2SJaroslaw Chachulski  Measurements include only CPU consumption. Default: enabled.
137b9403ae5SKarol Latecki- enable_bandwidth - bool. Measure bandwidth utilization on network
138b9403ae5SKarol Latecki  interfaces. Default: enabled.
139b06212cfSKarol Latecki- tuned_profile - tunedadm profile to apply on the system before starting
140b06212cfSKarol Latecki  the test.
141b06212cfSKarol Latecki- irq_scripts_dir - path to scripts directory of Mellanox mlnx-tools package;
142b06212cfSKarol Latecki  Used to run set_irq_affinity.sh script.
143b06212cfSKarol Latecki  Default: /usr/src/local/mlnx-tools/ofed_scripts
144ecbb99e4SKarol Latecki- enable_pm - bool;
145eb0159ccSMichal Berger  if bool is set to true, power measurement is enabled via collect-bmc-pm on
146ecbb99e4SKarol Latecki  the target side. Default: true.
147cdab715bSKarol Latecki- irq_settings - dict;
148cdab715bSKarol Latecki  Choose how to adjust network interface IRQ settings.
149cdab715bSKarol Latecki  mode: default - run IRQ alignment script with no additional options.
150cdab715bSKarol Latecki  mode: bynode - align IRQs to be processed only on CPU cores matching NIC
151cdab715bSKarol Latecki    NUMA node.
152cdab715bSKarol Latecki  mode: cpulist - align IRQs to be processed only on CPU cores provided
153cdab715bSKarol Latecki    in the cpulist parameter.
154cdab715bSKarol Latecki  cpulist: list of CPU cores to use for cpulist mode. Can be provided as
155cdab715bSKarol Latecki    list of individual cores ("[0,1,10]"), core ranges ("[0-10]"), or mix
156cdab715bSKarol Latecki    of both ("[0-1,10,20-22]")
157cdab715bSKarol Latecki  exclude_cpulist: reverse the effect of cpulist mode. Allow IRQ processing
158cdab715bSKarol Latecki    only on CPU cores which are not provided in cpulist parameter.
1595ec4a069SJaroslaw Chachulski- sock_impl - str. Specifies the socket implementation to be used. This could be 'posix' for
1605ec4a069SJaroslaw Chachulski  the POSIX socket interfaces, or 'uring' for the Linux io_uring interface.
1615ec4a069SJaroslaw Chachulski  Default: posix
16293be26a5SKarol Latecki
163b06212cfSKarol LateckiOptional, Kernel Target only:
16493be26a5SKarol Latecki
165b06212cfSKarol Latecki- nvmet_bin - path to nvmetcli binary, if not available in $PATH.
166b06212cfSKarol Latecki  Only for Kernel Target. Default: "nvmetcli".
167a42dfab1SKarol Latecki
168b06212cfSKarol LateckiOptional, SPDK Target only:
169f252ff1fSKarol Latecki
170b06212cfSKarol Latecki- zcopy_settings - bool. Disable or enable target-size zero-copy option.
171b06212cfSKarol Latecki  Default: false.
172b06212cfSKarol Latecki- scheduler_settings - str. Select SPDK Target thread scheduler (static/dynamic).
173b06212cfSKarol Latecki  Default: static.
174b06212cfSKarol Latecki- num_shared_buffers - int, number of shared buffers to allocate when
175b06212cfSKarol Latecki  creating transport layer. Default: 4096.
176160af093SKarol Latecki- max_queue_depth - int, max number of outstanding I/O per queue. Default: 128.
177b06212cfSKarol Latecki- dif_insert_strip - bool. Only for TCP transport. Enable DIF option when
178b06212cfSKarol Latecki  creating transport layer. Default: false.
179d9687a60SKarol Latecki- num_cqe - int, number of completion queue entries. See doc/json_rpc.md
180d9687a60SKarol Latecki  "nvmf_create_transport" section. Default: 4096.
181b06212cfSKarol Latecki- null_block_dif_type - int, 0-3. Level of DIF type to use when creating
182b06212cfSKarol Latecki  null block bdev. Default: 0.
1839b3f5e98SKarol Latecki- enable_dpdk_memory - bool. Wait for a fio ramp_time to finish and
1849b3f5e98SKarol Latecki  call env_dpdk_get_mem_stats RPC call to dump DPDK memory stats.
1859b3f5e98SKarol Latecki  Default: enabled.
18602cb1fe8SKarol Latecki- adq_enable - bool; only for TCP transport.
18702cb1fe8SKarol Latecki  Configure system modules, NIC settings and create priority traffic classes
18802cb1fe8SKarol Latecki  for ADQ testing. You need and ADQ-capable NIC like the Intel E810.
1894ce17359SKarol Latecki- bpf_scripts - list of bpftrace scripts that will be attached during the
1904ce17359SKarol Latecki  test run. Available scripts can be found in the spdk/scripts/bpf directory.
191ffef30aeSpaul luse- dsa_settings - bool. Only for TCP transport. Enable offloading CRC32C
192ffef30aeSpaul luse  calculation to DSA. You need a CPU with the Intel(R) Data Streaming
193b7e49409SJohn Kariuki  Accelerator (DSA) engine.
1949c262548SJaroslaw Chachulski- scheduler_core_limit - int, 0-100. Dynamic scheduler option to load limit on
1959c262548SJaroslaw Chachulski  the core to be considered full.
196cdab715bSKarol Latecki- irq_settings - dict;
197cdab715bSKarol Latecki  Choose how to adjust network interface IRQ settings.
198cdab715bSKarol Latecki  Same as in common options section, but SPDK Target allows more modes:
199cdab715bSKarol Latecki  mode: shared - align IRQs to be processed only on the same CPU cores which
200cdab715bSKarol Latecki    are already used by SPDK Target process.
201cdab715bSKarol Latecki  mode: split - align IRQs to be processed only on CPU cores which are not
202cdab715bSKarol Latecki    used by SPDK Target process.
203cdab715bSKarol Latecki  mode: split-bynode - same as "split", but reduce the number of CPU cores
204cdab715bSKarol Latecki    to use for IRQ processing to only these matching NIC NUMA node.
205f252ff1fSKarol Latecki
206b06212cfSKarol Latecki### Initiator system settings section
207f9dd94b5SKarol Latecki
208b06212cfSKarol LateckiThere can be one or more `initiatorX` setting sections, depending on the test setup.
209f9dd94b5SKarol Latecki
210b06212cfSKarol Latecki``` ~sh
211b06212cfSKarol Latecki"initiator1": {
212b06212cfSKarol Latecki  "ip": "10.0.0.1",
213b06212cfSKarol Latecki  "nic_ips": ["192.0.1.2"],
2149bacb862SKarol Latecki  "target_nic_ips": ["192.0.1.1"],
215b06212cfSKarol Latecki  "mode": "spdk",
216b06212cfSKarol Latecki  "fio_bin": "/path/to/fio/bin",
217b06212cfSKarol Latecki  "nvmecli_bin": "/path/to/nvmecli/bin",
218b06212cfSKarol Latecki  "cpus_allowed": "0,1,10-15",
219b06212cfSKarol Latecki  "cpus_allowed_policy": "shared",
220b06212cfSKarol Latecki  "num_cores": 4,
221b06212cfSKarol Latecki  "cpu_frequency": 2100000,
2222c8baa46Swawryk  "adq_enable": false,
223cdab715bSKarol Latecki  "kernel_engine": "io_uring",
224cdab715bSKarol Latecki  "irq_settings": { "mode": "bynode" }
225b06212cfSKarol Latecki}
226b06212cfSKarol Latecki```
22793be26a5SKarol Latecki
228b06212cfSKarol LateckiRequired:
22993be26a5SKarol Latecki
230b06212cfSKarol Latecki- ip - management IP address of initiator system to set up SSH connection.
231b06212cfSKarol Latecki- nic_ips - list of IP addresses of NIC ports to be used in test,
232b06212cfSKarol Latecki  local to given initiator system.
2339bacb862SKarol Latecki- target_nic_ips - list of IP addresses of Target NIC ports to which initiator
234b06212cfSKarol Latecki  will attempt to connect to.
235b06212cfSKarol Latecki- mode - initiator mode, "spdk" or "kernel". For SPDK, the bdev fio plugin
236b06212cfSKarol Latecki  will be used to connect to NVMe-oF subsystems and submit I/O. For "kernel",
237b06212cfSKarol Latecki  nvmecli will be used to connect to NVMe-oF subsystems and fio will use the
238b06212cfSKarol Latecki  libaio ioengine to submit I/Os.
23993be26a5SKarol Latecki
240b06212cfSKarol LateckiOptional, common:
24193be26a5SKarol Latecki
242b06212cfSKarol Latecki- nvmecli_bin - path to nvmecli binary; Will be used for "discovery" command
243b06212cfSKarol Latecki  (for both SPDK and Kernel modes) and for "connect" (in case of Kernel mode).
244b06212cfSKarol Latecki  Default: system-wide "nvme".
245b06212cfSKarol Latecki- fio_bin - path to custom fio binary, which will be used to run IO.
246b06212cfSKarol Latecki  Additionally, the directory where the binary is located should also contain
247b06212cfSKarol Latecki  fio sources needed to build SPDK fio_plugin for spdk initiator mode.
248b06212cfSKarol Latecki  Default: /usr/src/fio/fio.
249b06212cfSKarol Latecki- cpus_allowed - str, list of CPU cores to run fio threads on. Takes precedence
250b06212cfSKarol Latecki  before `num_cores` setting. Default: None (CPU cores randomly allocated).
251b06212cfSKarol Latecki  For more information see `man fio`.
252b06212cfSKarol Latecki- cpus_allowed_policy - str, "shared" or "split". CPU sharing policy for fio
253b06212cfSKarol Latecki  threads. Default: shared. For more information see `man fio`.
254b06212cfSKarol Latecki- num_cores - By default fio threads on initiator side will use as many CPUs
255b06212cfSKarol Latecki  as there are connected subsystems. This option limits the number of CPU cores
256b06212cfSKarol Latecki  used for fio threads to this number; cores are allocated randomly and fio
257b06212cfSKarol Latecki  `filename` parameters are grouped if needed. `cpus_allowed` option takes
258b06212cfSKarol Latecki  precedence and `num_cores` is ignored if both are present in config.
259b06212cfSKarol Latecki- cpu_frequency - int, custom CPU frequency to set. By default test setups are
260b06212cfSKarol Latecki  configured to run in performance mode at max frequencies. This option allows
261b06212cfSKarol Latecki  user to select CPU frequency instead of running at max frequency. Before
262b06212cfSKarol Latecki  using this option `intel_pstate=disable` must be set in boot options and
263b06212cfSKarol Latecki  cpupower governor be set to `userspace`.
264b06212cfSKarol Latecki- tuned_profile - tunedadm profile to apply on the system before starting
265b06212cfSKarol Latecki  the test.
266b06212cfSKarol Latecki- irq_scripts_dir - path to scripts directory of Mellanox mlnx-tools package;
267b06212cfSKarol Latecki  Used to run set_irq_affinity.sh script.
268b06212cfSKarol Latecki  Default: /usr/src/local/mlnx-tools/ofed_scripts
2692c8baa46Swawryk- kernel_engine - Select fio ioengine mode to run tests. io_uring libraries and
2702c8baa46Swawryk  io_uring capable fio binaries must be present on Initiator systems!
2712c8baa46Swawryk  Available options:
2722c8baa46Swawryk  - libaio (default)
2732c8baa46Swawryk  - io_uring
274cdab715bSKarol Latecki- irq_settings - dict;
275cdab715bSKarol Latecki  Same as "irq_settings" in Target common options section.
27693be26a5SKarol Latecki
27702cb1fe8SKarol LateckiOptional, SPDK Initiator only:
27802cb1fe8SKarol Latecki
27902cb1fe8SKarol Latecki- adq_enable - bool; only for TCP transport. Configure system modules, NIC
28002cb1fe8SKarol Latecki  settings and create priority traffic classes for ADQ testing.
28102cb1fe8SKarol Latecki  You need an ADQ-capable NIC like Intel E810.
282b7e49409SJohn Kariuki- enable_data_digest - bool; only for TCP transport. Enable the data
283b7e49409SJohn Kariuki  digest for the bdev controller. The target can use IDXD to calculate the
284b7e49409SJohn Kariuki  data digest or fallback to a software optimized implementation on system
285b7e49409SJohn Kariuki  that don't have the Intel(R) Data Streaming Accelerator (DSA) engine.
28602cb1fe8SKarol Latecki
287b06212cfSKarol Latecki### Fio settings section
288c4a330c9SKarol Latecki
289b06212cfSKarol Latecki``` ~sh
290b06212cfSKarol Latecki"fio": {
291b06212cfSKarol Latecki  "bs": ["4k", "128k"],
292b06212cfSKarol Latecki  "qd": [32, 128],
293b06212cfSKarol Latecki  "rw": ["randwrite", "write"],
294b06212cfSKarol Latecki  "rwmixread": 100,
2951c71de70STomasz Zawadzki  "rate_iops": 10000,
296b06212cfSKarol Latecki  "num_jobs": 2,
29723e767c4SKarol Latecki  "offset": true,
29823e767c4SKarol Latecki  "offset_inc": 10,
299b06212cfSKarol Latecki  "run_time": 30,
300b06212cfSKarol Latecki  "ramp_time": 30,
301b06212cfSKarol Latecki  "run_num": 3
302b06212cfSKarol Latecki}
303b06212cfSKarol Latecki```
304c4a330c9SKarol Latecki
305b06212cfSKarol LateckiRequired:
30693be26a5SKarol Latecki
307b06212cfSKarol Latecki- bs - fio IO block size
308b06212cfSKarol Latecki- qd -  fio iodepth
309b06212cfSKarol Latecki- rw - fio rw mode
310b06212cfSKarol Latecki- rwmixread - read operations percentage in case of mixed workloads
311b06212cfSKarol Latecki- num_jobs - fio numjobs parameter
312b06212cfSKarol Latecki  Note: may affect total number of CPU cores used by initiator systems
313b06212cfSKarol Latecki- run_time - fio run time
314b06212cfSKarol Latecki- ramp_time - fio ramp time, does not do measurements
315b06212cfSKarol Latecki- run_num - number of times each workload combination is run.
316b06212cfSKarol Latecki  If more than 1 then final result is the average of all runs.
31793be26a5SKarol Latecki
3181c71de70STomasz ZawadzkiOptional:
3191c71de70STomasz Zawadzki
3201c71de70STomasz Zawadzki- rate_iops - limit IOPS to this number
321*34edd9f1SKamil Godzwon- offset - bool; enable offsetting of the IO to the file. When this option is
32223e767c4SKarol Latecki  enabled the file is "split" into a number of chunks equal to "num_jobs"
32323e767c4SKarol Latecki  parameter value, and each "num_jobs" fio thread gets it's own chunk to
32423e767c4SKarol Latecki  work with.
32523e767c4SKarol Latecki  For more detail see "offset", "offset_increment" and "size" in fio man
32623e767c4SKarol Latecki  pages. Default: false.
32723e767c4SKarol Latecki- offset_inc - int; Percentage value determining the offset, size and
32823e767c4SKarol Latecki  offset_increment when "offset" option is enabled. By default if "offset"
32923e767c4SKarol Latecki  is enabled fio file will get split evenly between fio threads doing the
33023e767c4SKarol Latecki  IO. Offset_inc can be used to specify a custom value.
3311c71de70STomasz Zawadzki
332b06212cfSKarol Latecki#### Test Combinations
33393be26a5SKarol Latecki
334b06212cfSKarol LateckiIt is possible to specify more than one value for bs, qd and rw parameters.
335b06212cfSKarol LateckiIn such case script creates a list of their combinations and runs IO tests
336b06212cfSKarol Lateckifor all of these combinations. For example, the following configuration:
337e068db83SMaciej Wawryk
338b06212cfSKarol Latecki``` ~sh
339b06212cfSKarol Latecki  "bs": ["4k"],
340b06212cfSKarol Latecki  "qd": [32, 128],
341b06212cfSKarol Latecki  "rw": ["write", "read"]
342b06212cfSKarol Latecki```
343e068db83SMaciej Wawryk
344b06212cfSKarol Lateckiresults in following workloads being tested:
34593be26a5SKarol Latecki
346b06212cfSKarol Latecki- 4k-write-32
347b06212cfSKarol Latecki- 4k-write-128
348b06212cfSKarol Latecki- 4k-read-32
349b06212cfSKarol Latecki- 4k-read-128
35093be26a5SKarol Latecki
351b06212cfSKarol Latecki#### Important note about queue depth parameter
35293be26a5SKarol Latecki
353b06212cfSKarol Lateckiqd in fio settings section refers to iodepth generated per single fio target
354b06212cfSKarol Lateckidevice ("filename" in resulting fio configuration file). It is re-calculated
355b06212cfSKarol Lateckiwhile the script is running, so generated fio configuration file might contain
356b06212cfSKarol Lateckia different value than what user has specified at input, especially when also
357b06212cfSKarol Lateckiusing "numjobs" or initiator "num_cores" parameters. For example:
35893be26a5SKarol Latecki
359b06212cfSKarol LateckiTarget system exposes 4 NVMe-oF subsystems. One initiator system connects to
360b06212cfSKarol Lateckiall of these systems.
36193be26a5SKarol Latecki
362b06212cfSKarol LateckiInitiator configuration (relevant settings only):
36393be26a5SKarol Latecki
364b06212cfSKarol Latecki``` ~sh
365b06212cfSKarol Latecki"initiator1": {
366b06212cfSKarol Latecki  "num_cores": 1
367b06212cfSKarol Latecki}
368b06212cfSKarol Latecki```
369f9dd94b5SKarol Latecki
370b06212cfSKarol LateckiFio configuration:
371f9dd94b5SKarol Latecki
372b06212cfSKarol Latecki``` ~sh
373b06212cfSKarol Latecki"fio": {
374b06212cfSKarol Latecki  "bs": ["4k"],
375b06212cfSKarol Latecki  "qd": [128],
376b06212cfSKarol Latecki  "rw": ["randread"],
377b06212cfSKarol Latecki  "rwmixread": 100,
378b06212cfSKarol Latecki  "num_jobs": 1,
379b06212cfSKarol Latecki  "run_time": 30,
380b06212cfSKarol Latecki  "ramp_time": 30,
381b06212cfSKarol Latecki  "run_num": 1
382b06212cfSKarol Latecki}
383b06212cfSKarol Latecki```
38493be26a5SKarol Latecki
385b06212cfSKarol LateckiIn this case generated fio configuration will look like this
386b06212cfSKarol Latecki(relevant settings only):
387a42dfab1SKarol Latecki
388b06212cfSKarol Latecki``` ~sh
389b06212cfSKarol Latecki[global]
390b06212cfSKarol Lateckinumjobs=1
39193be26a5SKarol Latecki
392b06212cfSKarol Latecki[job_section0]
393b06212cfSKarol Lateckifilename=Nvme0n1
394b06212cfSKarol Lateckifilename=Nvme1n1
395b06212cfSKarol Lateckifilename=Nvme2n1
396b06212cfSKarol Lateckifilename=Nvme3n1
397b06212cfSKarol Lateckiiodepth=512
398b06212cfSKarol Latecki```
3993d8a0b19SKarol Latecki
400b06212cfSKarol Latecki`num_cores` option results in 4 connected subsystems to be grouped under a
401b06212cfSKarol Lateckisingle fio thread (job_section0). Because `iodepth` is local to `job_section0`,
402b06212cfSKarol Lateckiit is distributed between each `filename` local to job section in round-robin
403b06212cfSKarol Latecki(by default) fashion. In case of fio targets with the same characteristics
404b06212cfSKarol Latecki(IOPS & Bandwidth capabilities) it means that iodepth is distributed **roughly**
405b06212cfSKarol Lateckiequally. Ultimately above fio configuration results in iodepth=128 per filename.
406d6013743SJohn Kariuki
407b06212cfSKarol Latecki`numjobs` higher than 1 is also taken into account, so that desired qd per
408b06212cfSKarol Lateckifilename is retained:
40993be26a5SKarol Latecki
410b06212cfSKarol Latecki``` ~sh
411b06212cfSKarol Latecki[global]
412b06212cfSKarol Lateckinumjobs=2
413b06212cfSKarol Latecki
414b06212cfSKarol Latecki[job_section0]
415b06212cfSKarol Lateckifilename=Nvme0n1
416b06212cfSKarol Lateckifilename=Nvme1n1
417b06212cfSKarol Lateckifilename=Nvme2n1
418b06212cfSKarol Lateckifilename=Nvme3n1
419b06212cfSKarol Lateckiiodepth=256
420b06212cfSKarol Latecki```
421b06212cfSKarol Latecki
422b06212cfSKarol LateckiBesides `run_num`, more information on these options can be found in `man fio`.
423b06212cfSKarol Latecki
424b06212cfSKarol Latecki## Running the test
425b06212cfSKarol Latecki
426b06212cfSKarol LateckiBefore running the test script run the spdk/scripts/setup.sh script on Target
427b06212cfSKarol Lateckisystem. This binds the devices to VFIO/UIO userspace driver and allocates
428b06212cfSKarol Lateckihugepages for SPDK process.
429b06212cfSKarol Latecki
430d6013743SJohn KariukiRun the script on the NVMe-oF target system:
431d6013743SJohn Kariuki
432b06212cfSKarol Latecki``` ~sh
433d6013743SJohn Kariukicd spdk
4346e8e184bSKonrad Sztybersudo PYTHONPATH=$PYTHONPATH:$PWD/python scripts/perf/nvmf/run_nvmf.py
4353c8451e6SMaciej Wawryk```
436da5c9b32SMaciej Wawryk
437b06212cfSKarol LateckiBy default script uses config.json configuration file in the scripts/perf/nvmf
438b06212cfSKarol Lateckidirectory. You can specify a different configuration file at runtime as below:
439da5c9b32SMaciej Wawryk
440b06212cfSKarol Latecki``` ~sh
4416e8e184bSKonrad Sztybersudo PYTHONPATH=$PYTHONPATH:$PWD/python scripts/perf/nvmf/run_nvmf.py -c /path/to/config.json
442da5c9b32SMaciej Wawryk```
443e7fb0e9aSMaciej Wawryk
444b06212cfSKarol LateckiPYTHONPATH environment variable is needed because script uses SPDK-local Python
4456e8e184bSKonrad Sztybermodules. If you'd like to get rid of `PYTHONPATH=$PYTHONPATH:$PWD/python`
446b06212cfSKarol Lateckiyou need to modify your environment so that Python interpreter is aware of
447b06212cfSKarol Latecki`spdk/scripts` directory.
448b06212cfSKarol Latecki
449b06212cfSKarol Latecki## Test Results
450b06212cfSKarol Latecki
451b06212cfSKarol LateckiTest results for all workload combinations are printed to screen once the tests
452b06212cfSKarol Lateckiare finished. Additionally all aggregate results are saved to /tmp/results/nvmf_results.conf
4532f0fdf0eSPawel PiatekResults directory path can be changed by -r script parameter.
454