Skip to main content
NetApp Knowledge Base

How to optimize NFS mounts for Trident on OpenShift

Views:
32
Visibility:
Public
Votes:
0
Category:
astra_trident
Specialty:
nas
Last Updated:

Applies to

  • OpenShift Container Platform 4.x
  • OpenShift Virtualization 4.x
  • Trident with NFS-backed StorageClasses
  • ONTAP 9 using NFSv4.1 or NFSv4.2 backends
  • Red Hat Enterprise Linux CoreOS (RHCOS) worker and control-plane nodes

Description

This article provides baseline tuning guidance for Trident environments that use ONTAP NFS backends on OpenShift and show elevated latency or latency spikes under concurrent workloads, including OpenShift Virtualization workloads.

These settings are baseline recommendations, not universal defaults. Performance depends on workload profile, network topology, and backend configuration.

Apply Steps 1 and 2 as the baseline, re-evaluate performance, and use Step 3 only if workloads still underperform. Validate changes during a maintenance window and adjust as needed for the deployment.

Procedure

  1. Update the Trident backend or StorageClass mount options to sec=sys,nconnect=8.
    • Backend example:
      kind: TridentBackendConfig
      spec:
        nfsMountOptions: sec=sys,nconnect=8
    • StorageClass example:
      mountOptions:
      - sec=sys
      - nconnect=8
    • If you use the StorageClass method, remove and recreate the StorageClass with the same name.
    • Existing pods and VMs do not pick up the change until the PVCs are remounted through restart, stop/start, or live migration.
  2. Apply a worker MachineConfig that loads the sunrpc and nfs modules and sets the live values.
    • Set /sys/module/sunrpc/parameters/tcp_max_slot_table_entries to 128.
    • Set /sys/module/nfs/parameters/max_session_slots to 1024.
    • Wait for the worker pool to finish, then apply the same systemd unit through a control-plane MachineConfig.
  3. Monitor the rollout and confirm both pools complete successfully.
    oc get mcp worker -w
    oc get mcp master -w
    • Confirm UPDATED=True, UPDATING=False, and DEGRADED=False.
  4. Validate the service and live values on an updated node.
    oc debug node/<node> -- chroot /host systemctl status nfs-slot-tuning.service --no-pager
    oc debug node/<node> -- chroot /host sh -c 'cat /sys/module/sunrpc/parameters/tcp_max_slot_table_entries; cat /sys/module/nfs/parameters/max_session_slots'
  5. Increase the ONTAP SVM setting -v4.x-session-num-slots incrementally.
    • Increase from 180 to 256, 512, 768, and then 1024.
    • set -privilege advanced
      vserver nfs show -vserver <svm_name> -fields v4.x-session-num-slots
      vserver nfs modify -vserver <svm_name> -v4.x-session-num-slots <value>
      set -privilege admin
    • Remount or restart affected workloads so new NFSv4.x sessions negotiate the updated slot count.
  6. Roll back in reverse order if latency regresses.
    • Revert Trident mount options to sec=sys.
    • Reset ONTAP session slots to 180:
      set -privilege advanced
      vserver nfs modify -vserver <svm_name> -v4.x-session-num-slots 180
      set -privilege admin
    • Delete the worker MachineConfig, wait for completion, then delete the control-plane MachineConfig.

Partner Notes

 

Additional Information

  • Roll out one pool at a time. Do not update worker and control-plane pools concurrently.
  • Confirm PodDisruptionBudgets do not block drains before starting.
  • max_session_slots=1024 is the client-side ceiling. ONTAP negotiates down to the lower client/server value for new NFSv4.1 or NFSv4.2 sessions.
  • tcp_max_slot_table_entries=128 sets an explicit per-TCP-connection RPC cap. Do not describe it as raising the slot table.
  • This workflow uses a systemd unit instead of modprobe.d so the module paths exist and the live values are applied at boot.
  • ONTAP session-slot changes apply only to newly established NFSv4.x sessions.
  • Optionally enable the OpenShift node-exporter mountstats collector to measure client-side NFS activity before and after tuning.

Internal Notes

 

Sign in to view the entire content of this KB article.

New to NetApp?

Learn more about our award-winning Support

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.