跳转到主内容

如何优化 Astra Trident 在 OpenShift 上的 NFS 挂载

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

适用于

  • OpenShift 容器平台 4.x
  • OpenShift 虚拟化 4.x
  • Astra Trident 与基于 NFS 的 StorageClasses
  • 使用 NFSv4.1 或 NFSv4.2 后端的 ONTAP 9
  • Red Hat Enterprise Linux CoreOS (RHCOS) 工作节点和控制平面节点

说明

本文为在 OpenShift 上使用 ONTAP NFS 后端并在并发工作负载(包括 OpenShift 虚拟化工作负载)下出现高延迟或延迟峰值的 Astra Trident 环境提供基线调整指导。

这些设置是基线建议,而不是通用默认设置。性能取决于工作负载配置文件、网络拓扑和后端配置。

将步骤 1 和步骤 2 作为基线应用,重新评估性能,仅在工作负载仍表现不佳时才使用步骤 3。在维护窗口期间验证更改,并根据部署需要进行调整。

操作步骤

  1. 将 Trident 后端或 StorageClass 挂载选项更新sec=sys,nconnect=8
    • 后端示例:
      kind: TridentBackendConfig
      spec:
        nfsMountOptions: sec=sys,nconnect=8
    • StorageClass 示例:
      mountOptions:
      - sec=sys
      - nconnect=8
    • 如果使用 StorageClass 方法,请移除并重新创建同名的 StorageClass。
    • 在通过重新启动、停止/启动或实时迁移重新挂载 PVC 之前,现有的 Pod 和 VM 不会接收更改。
  2. 应用工作节点 MachineConfig,以加载 sunrpcnfs 模块并设置实时值。
    • /sys/module/sunrpc/parameters/tcp_max_slot_table_entries 设置为 128
    • /sys/module/nfs/parameters/max_session_slots 设置为 1024
    • 等待工作池完成,然后通过控制平面 MachineConfig 应用相同的 systemd 单元。
  3. 监控推出并确认两个池均已成功完成。
    oc get mcp worker -w
    oc get mcp master -w
    • 确认 UPDATED=TrueUPDATING=FalseDEGRADED=False
  4. 在更新的节点上验证服务和实时值
    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. 逐步增加 ONTAP SVM 设置 -v4.x-session-num-slots
    • 180 增加到 256512768,然后增加到 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
    • 重新挂载或重新启动受影响的工作负载,以便新的 NFSv4.x 会话协商更新后的插槽计数。
  6. 如果延迟回退,则按相反顺序回滚。
    • 将 Trident 挂载选项恢复为sec=sys
    • 将 ONTAP 会话插槽重置为180
      set -privilege advanced
      vserver nfs modify -vserver <svm_name> -v4.x-session-num-slots 180
      set -privilege admin
    • 删除 worker MachineConfig,等待完成,然后删除 control-plane MachineConfig。

合作伙伴备注

 

追加信息

  • 每次推出一个节点池。请勿同时更新 worker 和控制平面池。
  • 启动前,请确认 PodDisruptionBudgets 不会阻止节点排空操作。
  • max_session_slots=1024 是客户端侧的上限值。ONTAP 会针对新的 NFSv4.1 或 NFSv4.2 会话协商至较低的客户端/服务器值。
  • tcp_max_slot_table_entries=128 用于设置每个 TCP 连接的显式 RPC 上限。请勿将其描述为提升插槽表。
  • 此工作流使用 systemd 单元而非 modprobe.d,以确保模块路径存在并在引导时应用实时值。
  • ONTAP 会话插槽更改仅适用于新建立的 NFSv4.x 会话。
  • 可选择启用 OpenShift 节点导出器的 mountstats 收集器,以便在调优前后测量客户端 NFS 活动。

内部参考

 

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.