The provided demo script ensures a structured approach to configuring, testing and validating NVMe performance of the Napatech IPU running Link-Storage™ Software while maintaining a clear log trail for each test run.
Before you begin
- Installed a Napatech IPU in a server. See Installing a Napatech IPU.
- Programmed the IPU with an appropriate FPGA image. See Napatech Link-Storage™ Software FPGA images.
- Installed the SPDK on the target server. See Installing the SPDK on the Target Server.
- Installed the Link-Storage™ Software package on the IPU. See Installing the Napatech SDPK on the IPU.
- Configured the target server. See Configuring the Target Server with NVMe™ SSD Disks or Configuring the Target Server with RAM disks.
- Configured the IPU. See Configuring the IPU.
- Configured the test server. See Preparing the Test Server.
- Activated a Python virtual environment on the test server. For
example:
test# source /opt/venv39/bin/activate (venv39) test#
The prompt will show (venv39) before the command line as shown in the example.
About this task
To run the demo scenario, the test script must be executed with the appropriate parameters.
See the following help output for
reference:
test# cd /opt/ipu_workload_nvme/src test# python3 -m demo.storage.main --help usage: main.py [-h] [-b {Malloc,NVMe}] [-io N] [-r N] [-bf BASELINE_FILE] Description: Simulate scenario with I/O workload using FIO tool. IP addresses to target, initiator and SoC must be configured in 'config.ini'. Test server should have passwordless root access over SSH to provided network hosts. Test results will be shown in the metrics table and saved under logs/run-XXX/fio_results.json. Optionally metrics could be compared with results from any previous build or from custom baseline file (expected structure is shown in fio_results.json). Examples: python -m demo.storage.main python -m demo.storage.main --bdev NVMe --runtime 120 python -m demo.storage.main --bdev Malloc --iodepth 128 python -m demo.storage.main --iodepth 256 --runtime 60 --baseline-file fio_results.json options: -h, --help show this help message and exit -b {Malloc,NVMe}, --bdev {Malloc,NVMe} Block devices to be created: Malloc (ramdisk) or NVMe (default: Malloc) -io N, --iodepth N I/O requests number submitted at a time (default: 256) -r N, --runtime N Test duration (default: 30) -bf BASELINE_FILE, --baseline-file BASELINE_FILE Display a 'baseline' result from a saved JSON file to be compared with current run Don't forget to configure IPs to remotes in 'config.ini'
The demo script facilitates an evaluation of NVMe-oF performance using the
fio tool. It performs the following tasks:
- Starts the SPDK NVMe-oF target process: Launches the target process and configure block devices with NVMe-oF subsystems.
- Binds management PCIe function: Associates the management PCIe function of the IPU with the vfio-pci driver.
- NVMe controller attachment: Attaches NVMe controllers to the NVMe devices on the target server.
- Virtio block device construction: Builds a virtio block device for storage access.
- NVMe devices mapping: Maps NVMe devices to the constructed virtio block devices.
- Performance test with fio: Executes the fio workload tool to simulate and analyze I/O performance under various configurations.
- Cleanup: Cleans up configurations, releasing resources and ensuring the environment is restored to its initial state.
The test framework stores results and logs in a dedicated directory for each run, located
on the test server
at:
/opt/ipu_workload_nvme/src/logs/run-<index>/where index is a sequential number starting from 000.
Note: The following prompt is used to indicate which part of the system to run the provided
commands on.
- test#: The test server where the test script runs to execute the demo scenarios.
Procedure
Run the test script.
For
example:
(venv39) test# cd /opt/ipu_workload_nvme/src (venv39) test# python3 -m demo.storage.main --bdev NVMe --iodepth 256 \ --runtime 30 --baseline-file fio_results.jsonwhere:
- --bdev NVMe: Specifies the block device type. The default is Malloc.
- --iodepth 256: Specifies how many I/O requests are issued at a time. Execution with --iodepth 256 submits 256 I/O requests at a time. The default is 256.
- --runtime 30: Sets the runtime limit in seconds. The test will continue until it completes the configured I/O workload or reaches the specified time limit. The default is 30 seconds.
- --baseline-file fio_results.json: Specifies the path to a file
containing baseline metrics for comparison. Use the previously created
fio_results.json file located in the
/opt/ipu_workload_nvme/src/logs/run-<index>/ directory,
or omit this option when running the script for the first time. For first-time
execution, run the following
command:
(venv39) test# python3 -m demo.storage.main --bdev NVMe
The result will be saved in the /opt/ipu_workload_nvme/src/logs/run-000/fio_results.json file.
An output
example:
… … [15:52:13.559] main | INFO | Storage Demo Configuration: BDEV - NVMe, IODEPTH - 256 Storage Demo Results ┌─────────┬──────────┬─────────┬──────────┬─────────┬──────────┬─────────┐ │ │ Read │ Read │ Write │ Write │ RW │ RW │ ╞═════════╪══════════╪═════════╪══════════╪═════════╪══════════╪═════════╡ │ Metrics │ Bw(MB/s) │ IOPS(k) │ Bw(MB/s) │ IOPS(k) │ Bw(MB/s) │ IOPS(k) │ ├─────────┼──────────┼─────────┼──────────┼─────────┼──────────┼─────────┤ │ Current │ 647.5 │ 165.8 │ 277.6 │ 71.1 │ 925.1 │ 236.9 │ └─────────┴──────────┴─────────┴──────────┴─────────┴──────────┴─────────┘