NFS over RDMA
Mount an export over RDMA for faster reads and for GPUDirect Storage clients.
The gateway serves NFS over RDMA on port 20049 as well as over TCP on port 2049. It does
this on each node that runs the RDMA build of AIStor, minio.rdma, and has an RDMA
device with an active port. There is no setting to turn on.
Choose RDMA or TCP
Use RDMA for read-heavy work on a lossless network. Keep TCP for write-heavy work.
| Workload | RDMA compared with TCP |
|---|---|
| Large reads | Usually faster. RDMA moves the data without copying it through the TCP stack. |
| Writes | Usually slower than TCP. Test your write workload before you move it to RDMA. |
| A network that drops packets | Throughput collapses under load. RDMA needs a lossless fabric. |
| GPUDirect Storage (cuFile) reads | Needs RDMA. GPUDirect Storage moves data straight into GPU memory. |
Measure your own workload on both transports before you choose. Mount the same export twice on one client, once over each transport, and run the same job on each mount:
sudo mkdir -p /mnt/carol-tcp /mnt/carol-rdma
sudo mount -t nfs -o vers=4.1,nosharecache node01.example.com:/carol /mnt/carol-tcp
sudo mount -t nfs -o vers=4.1,nosharecache,proto=rdma,port=20049 node01.example.com:/carol /mnt/carol-rdma
fio --name=compare --directory=/mnt/carol-tcp --rw=read --bs=1m --size=4g --direct=1 --numjobs=8 --group_reporting
fio --name=compare --directory=/mnt/carol-rdma --rw=read --bs=1m --size=4g --direct=1 --numjobs=8 --group_reportingnosharecache makes the client open a separate connection for each mount. Set --rw,
--bs and --numjobs to match your application, and run each job more than once.
Check that a node serves RDMA
AIStor checks for an RDMA device with a port in the ACTIVE state when it starts. On the
node:
cat /sys/class/infiniband/*/ports/*/stateAt least one line must read 4: ACTIVE. If the port came up after AIStor started,
restart AIStor on the node. A node without an active port serves TCP only, and an RDMA
mount through it fails.
Every client also needs a network route to port 20049 on the node it mounts through.
Make the network lossless
RDMA over Converged Ethernet (RoCE) expects a network that pauses under congestion instead of dropping packets. Without that, RDMA still runs, but lost packets force retransmits and throughput collapses under load. A short test can pass before this shows.
Configure priority flow control (PFC) and explicit congestion notification (ECN) for one traffic priority:
- on every gateway node,
- on every RDMA client,
- on every switch between them.
The settings work only when every host and switch agrees on them. Your network adapter vendor documents how to set them.
Prepare a client
Load the kernel's NFS RDMA transport:
sudo modprobe rpcrdmaIf the client runs NVIDIA MLNX_OFED (MOFED), install mlnx-nfsrdma-dkms first. MOFED
replaces the kernel's RDMA core, so the distribution's own rpcrdma module refuses to
load. The MOFED package builds one that matches:
sudo apt install mlnx-nfsrdma-dkms # Debian, Ubuntu
sudo modprobe rpcrdmadmesg then shows RPC: Registered rdma transport module.
Mount an export over RDMA
sudo mkdir -p /mnt/carol
sudo mount -t nfs -o vers=4.1,proto=rdma,port=20049 node01.example.com:/carol /mnt/carolEvery other mount option works as on TCP. See Mount options.
Confirm the mount uses RDMA
A mount that fell back to TCP looks the same in df. Check the transport the kernel
uses for your mount point, here /mnt/carol:
awk '/ mounted on \/mnt\/carol /{m=1} m && /xprt:/{print; exit}' /proc/self/mountstatsxprt: rdma with counters that grow during I/O means the mount uses RDMA. xprt: tcp
means it does not.
Use GPUDirect Storage clients
GPUDirect Storage needs nothing on the gateway beyond NFS over RDMA. Everything else is on the GPU host:
- Mount the export over RDMA, as above. Use
rsize=1048576,wsize=1048576, as NVIDIA recommends for NFS. - Use the open NVIDIA kernel modules, the
-openbuild of the driver version you run. Thenvidia-fsmodule does not load with the proprietary driver. - Install and set up GPUDirect Storage as NVIDIA's GPUDirect Storage documentation
describes, including the
nvidia-fsmodule. - Run
gdscheck -p. It must list NFS as supported. If it lists NFS ascompat, cuFile copies through host memory instead.
Start with 1 MiB reads from many threads, then try larger ones. Linux sends at most 1 MiB in one NFS request and splits a larger read into several, but a larger cuFile read still makes fewer calls into the I/O stack and can be faster.
Fix an RDMA mount
| Symptom | Cause and fix |
|---|---|
mount.nfs: an incorrect mount option was specified | rpcrdma is not loaded on the client. See Prepare a client. |
modprobe rpcrdma fails with Invalid argument | dmesg shows disagrees about version of symbol. The client runs MOFED: install mlnx-nfsrdma-dkms. |
| The mount is refused or times out | The node serves TCP only: see Check that a node serves RDMA. Or the client cannot reach the node's RDMA address: check the route and any firewall rule for port 20049 on the RDMA network. |
The mount succeeds, but mountstats shows xprt: tcp | The mount command did not ask for proto=rdma. |