第 15 章 使用性能配置集调整节点以实现低延迟


使用集群性能配置集调整节点以实现低延迟。您可以限制 infra 和应用程序容器的 CPU,配置巨页、Hyper-Threading,并为对延迟敏感的进程配置 CPU 分区。

15.1. 创建性能配置集

您可以使用 Performance Profile Creator (PPC) 工具创建集群性能配置集。PPC 是 Node Tuning Operator 的功能。

PPC 将有关集群的信息与用户提供的配置相结合,以生成适合您的硬件、拓扑和用例的性能配置集。

注意

性能配置集只适用于集群直接访问底层硬件资源的裸机环境。您可以为单节点 OpenShift 和多节点集群配置性能配置集。

以下是在集群中创建和应用性能配置集的高级工作流:

  • 为您要使用性能配置为目标的节点创建机器配置池 (MCP)。在单节点 OpenShift 集群中,您必须使用 master MCP,因为集群中只有一个节点。
  • 使用 must-gather 命令收集有关集群的信息。
  • 使用 PPC 工具使用以下方法之一创建性能配置集:

    • 使用 Podman 运行 PPC 工具。
    • 使用 wrapper 脚本运行 PPC 工具。
  • 为您的用例配置性能配置集,并将性能配置集应用到集群。
注意

在 Telco 中,因为缺少对 cgroup v2 的支持,使用 PerformanceProfile 进行低延迟、实时和 Data Plane Development Kit (DPDK) 工作负载的集群会自动恢复到使用 cgroup v1。如果您使用 PerformanceProfile,则不支持启用 cgroup v2。

15.1.1. 关于性能配置集创建器

Performance Profile Creator (PPC) 是一个命令行工具,由 Node Tuning Operator 提供,它可帮助您为集群创建性能配置集。

最初,您可以使用 PPC 工具处理 must-gather 数据来显示集群的关键性能配置,包括以下信息:

  • 使用分配的 CPU ID 进行 NUMA 单元分区
  • 超线程节点配置

您可以使用这些信息来帮助配置性能配置集。

运行 PPC

为 PPC 工具指定性能配置参数,以生成适合您的硬件、拓扑和用例的推荐性能配置集。

您可以使用以下方法之一运行 PPC:

  • 使用 Podman 运行 PPC
  • 使用 wrapper 脚本运行 PPC
注意

使用 wrapper 脚本将一些更精细的 Podman 任务抽象到可执行脚本中。例如,wrapper 脚本处理诸如拉取和运行所需容器镜像、将目录挂载到容器等任务,并通过 Podman 直接向容器提供参数。两种方法都获得相同的结果。

15.1.2. 为性能调整创建机器配置池到目标节点

对于多节点集群,您可以定义机器配置池 (MCP) 来识别您要使用性能配置集配置的目标节点。

在单节点 OpenShift 集群中,您必须使用 master MCP,因为集群中只有一个节点。您不需要为单节点 OpenShift 集群创建单独的 MCP。

先决条件

  • cluster-admin 角色访问权限。
  • 已安装 OpenShift CLI(oc)。

流程

  1. 运行以下命令为配置标记目标节点:

    $ oc label node <node_name> node-role.kubernetes.io/worker-cnf="" 1
    1
    <node_name> 替换为节点的名称。本例应用 worker-cnf 标签。
  2. 创建包含目标节点的 MachineConfigPool 资源:

    1. 创建定义 MachineConfigPool 资源的 YAML 文件:

      mcp-worker-cnf.yaml 文件示例

      apiVersion: machineconfiguration.openshift.io/v1
      kind: MachineConfigPool
      metadata:
        name: worker-cnf 1
        labels:
          machineconfiguration.openshift.io/role: worker-cnf 2
      spec:
        machineConfigSelector:
          matchExpressions:
            - {
                 key: machineconfiguration.openshift.io/role,
                 operator: In,
                 values: [worker, worker-cnf],
              }
        paused: false
        nodeSelector:
          matchLabels:
            node-role.kubernetes.io/worker-cnf: "" 3

      1
      MachineConfigPool 资源指定一个名称。
      2
      为机器配置池指定唯一标签。
      3
      使用您定义的目标标签指定节点。
    2. 运行以下命令来应用 MachineConfigPool 资源:

      $ oc apply -f mcp-worker-cnf.yaml

      输出示例

      machineconfigpool.machineconfiguration.openshift.io/worker-cnf created

验证

  • 运行以下命令,检查集群中的机器配置池:

    $ oc get mcp

    输出示例

    NAME         CONFIG                                                 UPDATED   UPDATING   DEGRADED   MACHINECOUNT   READYMACHINECOUNT   UPDATEDMACHINECOUNT   DEGRADEDMACHINECOUNT   AGE
    master       rendered-master-58433c7c3c1b4ed5ffef95234d451490       True      False      False      3              3                   3                     0                      6h46m
    worker       rendered-worker-168f52b168f151e4f853259729b6azc4       True      False      False      2              2                   2                     0                      6h46m
    worker-cnf   rendered-worker-cnf-168f52b168f151e4f853259729b6azc4   True      False      False      1              1                   1                     0                      73s

15.1.3. 为 PPC 收集集群数据

Performance Profile Creator(PPC)工具需要 must-gather 数据。作为集群管理员,运行 must-gather 命令来捕获集群的信息。

先决条件

  • 使用具有 cluster-admin 角色的用户访问集群。
  • 已安装 OpenShift CLI(oc)。
  • 您识别要使用性能配置集配置的目标 MCP。

流程

  1. 进入存储 must-gather 数据的目录。
  2. 运行以下命令来收集集群信息:

    $ oc adm must-gather

    该命令在本地目录中创建带有 must-gather 数据的文件夹,其命名格式类似如下:must-gather.local.1971646453781853027

  3. 可选:从 must-gather 目录创建一个压缩文件:

    $ tar cvaf must-gather.tar.gz <must_gather_folder> 1
    1
    使用 must-gather 数据文件夹的名称替换。
    注意

    如果您正在运行性能配置集 Creator wrapper 脚本,则需要压缩输出。

其他资源

15.1.4. 使用 Podman 运行 Performance Profile Creator

作为集群管理员,您可以使用带有 Performance Profile Creator (PPC) 的 Podman 来创建性能配置集。

有关 PPC 参数的更多信息,请参阅 "Performance Profile Creator 参数" 部分。

重要

PPC 使用集群中的 must-gather 数据来创建性能配置集。如果您对集群进行任何更改,如重新标记针对性能配置的节点,则必须在再次运行 PPC 前重新创建 must-gather 数据。

先决条件

  • 使用具有 cluster-admin 角色的用户访问集群。
  • 在裸机硬件上安装的集群。
  • 已安装 podman 和 OpenShift CLI (oc)。
  • 访问 Node Tuning Operator 镜像。
  • 您识别包含用于配置的目标节点的机器配置池。
  • 您可以访问集群的 must-gather 数据。

流程

  1. 运行以下命令检查机器配置池:

    $ oc get mcp

    输出示例

    NAME         CONFIG                                                 UPDATED   UPDATING   DEGRADED   MACHINECOUNT   READYMACHINECOUNT   UPDATEDMACHINECOUNT   DEGRADEDMACHINECOUNT   AGE
    master       rendered-master-58433c8c3c0b4ed5feef95434d455490       True      False      False      3              3                   3                     0                      8h
    worker       rendered-worker-668f56a164f151e4a853229729b6adc4       True      False      False      2              2                   2                     0                      8h
    worker-cnf   rendered-worker-cnf-668f56a164f151e4a853229729b6adc4   True      False      False      1              1                   1                     0                      79m

  2. 运行以下命令,使用 Podman 向 registry.redhat.io 进行身份验证:

    $ podman login registry.redhat.io
    Username: <user_name>
    Password: <password>
  3. 可选:运行以下命令来显示 PPC 工具的帮助信息:

    $ podman run --rm --entrypoint performance-profile-creator registry.redhat.io/openshift4/ose-cluster-node-tuning-rhel9-operator:v4.14 -h

    输出示例

    A tool that automates creation of Performance Profiles
    
    Usage:
      performance-profile-creator [flags]
    
    Flags:
          --disable-ht                        Disable Hyperthreading
      -h, --help                              help for performance-profile-creator
          --info string                       Show cluster information; requires --must-gather-dir-path, ignore the other arguments. [Valid values: log, json] (default "log")
          --mcp-name string                   MCP name corresponding to the target machines (required)
          --must-gather-dir-path string       Must gather directory path (default "must-gather")
          --offlined-cpu-count int            Number of offlined CPUs
          --per-pod-power-management          Enable Per Pod Power Management
          --power-consumption-mode string     The power consumption mode.  [Valid values: default, low-latency, ultra-low-latency] (default "default")
          --profile-name string               Name of the performance profile to be created (default "performance")
          --reserved-cpu-count int            Number of reserved CPUs (required)
          --rt-kernel                         Enable Real Time Kernel (required)
          --split-reserved-cpus-across-numa   Split the Reserved CPUs across NUMA nodes
          --topology-manager-policy string    Kubelet Topology Manager Policy of the performance profile to be created. [Valid values: single-numa-node, best-effort, restricted] (default "restricted")
          --user-level-networking             Run with User level Networking(DPDK) enabled

  4. 要显示集群的信息,请运行以下命令使用 log 参数运行 PPC 工具:

    $ podman run --entrypoint performance-profile-creator -v <path_to_must_gather>:/must-gather:z registry.redhat.io/openshift4/ose-cluster-node-tuning-rhel9-operator:v4.14 --info log --must-gather-dir-path /must-gather
    • --entrypoint performance-profile-creator 将性能配置集创建者定义为 podman 的新入口点。
    • -v <path_to_must_gather> 指定到以下组件之一的路径:

      • 包含 must-gather 数据的目录。
      • 包含 must-gather 解压缩的 .tar 文件的现有目录。
    • --info log 指定输出格式的值。

      输出示例

      level=info msg="Cluster info:"
      level=info msg="MCP 'master' nodes:"
      level=info msg=---
      level=info msg="MCP 'worker' nodes:"
      level=info msg="Node: host.example.com (NUMA cells: 1, HT: true)"
      level=info msg="NUMA cell 0 : [0 1 2 3]"
      level=info msg="CPU(s): 4"
      level=info msg="Node: host1.example.com (NUMA cells: 1, HT: true)"
      level=info msg="NUMA cell 0 : [0 1 2 3]"
      level=info msg="CPU(s): 4"
      level=info msg=---
      level=info msg="MCP 'worker-cnf' nodes:"
      level=info msg="Node: host2.example.com (NUMA cells: 1, HT: true)"
      level=info msg="NUMA cell 0 : [0 1 2 3]"
      level=info msg="CPU(s): 4"
      level=info msg=---

  5. 运行以下命令来创建性能配置集。这个示例使用示例 PPC 参数和值:

    $ podman run --entrypoint performance-profile-creator -v <path_to_must_gather>:/must-gather:z registry.redhat.io/openshift4/ose-cluster-node-tuning-rhel9-operator:v4.14 --mcp-name=worker-cnf --reserved-cpu-count=1 --rt-kernel=true --split-reserved-cpus-across-numa=false --must-gather-dir-path /must-gather --power-consumption-mode=ultra-low-latency --offlined-cpu-count=1 > my-performance-profile.yaml
    • -v <path_to_must_gather> 指定到以下组件之一的路径:

      • 包含 must-gather 数据的目录。
      • 包含 must-gather 解压缩的 .tar 文件的目录。
    • --mcp-name=worker-cnf 指定 worker-=cnf 机器配置池。
    • --reserved-cpu-count=1 指定一个保留 CPU。
    • --rt-kernel=true 启用实时内核。
    • --split-reserved-cpus-across-numa=false 禁用跨 NUMA 节点的保留 CPU 分割。
    • --power-consumption-mode=ultra-low-latency 指定最大延迟,这会增加功耗。
    • --offlined-cpu-count=1 指定一个离线 CPU。

      注意

      本例中的 mcp-name 参数根据 oc get mcp 命令的输出设置为 worker-cnf。对于单节点 OpenShift,请使用 --mcp-name=master

      输出示例

      level=info msg="Nodes targeted by worker-cnf MCP are: [worker-2]"
      level=info msg="NUMA cell(s): 1"
      level=info msg="NUMA cell 0 : [0 1 2 3]"
      level=info msg="CPU(s): 4"
      level=info msg="1 reserved CPUs allocated: 0 "
      level=info msg="2 isolated CPUs allocated: 2-3"
      level=info msg="Additional Kernel Args based on configuration: []"

  6. 运行以下命令,查看创建的 YAML 文件:

    $ cat my-performance-profile.yaml

    输出示例

    ---
    apiVersion: performance.openshift.io/v2
    kind: PerformanceProfile
    metadata:
      name: performance
    spec:
      cpu:
        isolated: 2-3
        offlined: "1"
        reserved: "0"
      machineConfigPoolSelector:
        machineconfiguration.openshift.io/role: worker-cnf
      nodeSelector:
        node-role.kubernetes.io/worker-cnf: ""
      numa:
        topologyPolicy: restricted
      realTimeKernel:
        enabled: true
      workloadHints:
        highPowerConsumption: true
        perPodPowerManagement: false
        realTime: true

  7. 应用生成的配置集:

    $ oc apply -f my-performance-profile.yaml

    输出示例

    performanceprofile.performance.openshift.io/performance created

15.1.5. 运行性能配置集 Creator wrapper 脚本

wrapper 脚本简化了使用 Performance Profile Creator (PPC) 工具创建性能配置集的过程。脚本处理诸如拉取和运行所需容器镜像、将目录挂载到容器等任务,并通过 Podman 直接向容器提供参数。

有关 Performance Profile Creator 参数的更多信息,请参阅 "Performance Profile Creator 参数" 部分。

重要

PPC 使用集群中的 must-gather 数据来创建性能配置集。如果您对集群进行任何更改,如重新标记针对性能配置的节点,则必须在再次运行 PPC 前重新创建 must-gather 数据。

先决条件

  • 使用具有 cluster-admin 角色的用户访问集群。
  • 在裸机硬件上安装的集群。
  • 已安装 podman 和 OpenShift CLI (oc)。
  • 访问 Node Tuning Operator 镜像。
  • 您识别包含用于配置的目标节点的机器配置池。
  • 访问 must-gather tarball。

流程

  1. 在本地机器上创建一个文件,例如 run-perf-profile-creator.sh

    $ vi run-perf-profile-creator.sh
  2. 将以下代码粘贴到文件中:

    #!/bin/bash
    
    readonly CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-podman}
    readonly CURRENT_SCRIPT=$(basename "$0")
    readonly CMD="${CONTAINER_RUNTIME} run --entrypoint performance-profile-creator"
    readonly IMG_EXISTS_CMD="${CONTAINER_RUNTIME} image exists"
    readonly IMG_PULL_CMD="${CONTAINER_RUNTIME} image pull"
    readonly MUST_GATHER_VOL="/must-gather"
    
    NTO_IMG="registry.redhat.io/openshift4/ose-cluster-node-tuning-rhel9-operator:v4.14"
    MG_TARBALL=""
    DATA_DIR=""
    
    usage() {
      print "Wrapper usage:"
      print "  ${CURRENT_SCRIPT} [-h] [-p image][-t path] -- [performance-profile-creator flags]"
      print ""
      print "Options:"
      print "   -h                 help for ${CURRENT_SCRIPT}"
      print "   -p                 Node Tuning Operator image"
      print "   -t                 path to a must-gather tarball"
    
      ${IMG_EXISTS_CMD} "${NTO_IMG}" && ${CMD} "${NTO_IMG}" -h
    }
    
    function cleanup {
      [ -d "${DATA_DIR}" ] && rm -rf "${DATA_DIR}"
    }
    trap cleanup EXIT
    
    exit_error() {
      print "error: $*"
      usage
      exit 1
    }
    
    print() {
      echo  "$*" >&2
    }
    
    check_requirements() {
      ${IMG_EXISTS_CMD} "${NTO_IMG}" || ${IMG_PULL_CMD} "${NTO_IMG}" || \
          exit_error "Node Tuning Operator image not found"
    
      [ -n "${MG_TARBALL}" ] || exit_error "Must-gather tarball file path is mandatory"
      [ -f "${MG_TARBALL}" ] || exit_error "Must-gather tarball file not found"
    
      DATA_DIR=$(mktemp -d -t "${CURRENT_SCRIPT}XXXX") || exit_error "Cannot create the data directory"
      tar -zxf "${MG_TARBALL}" --directory "${DATA_DIR}" || exit_error "Cannot decompress the must-gather tarball"
      chmod a+rx "${DATA_DIR}"
    
      return 0
    }
    
    main() {
      while getopts ':hp:t:' OPT; do
        case "${OPT}" in
          h)
            usage
            exit 0
            ;;
          p)
            NTO_IMG="${OPTARG}"
            ;;
          t)
            MG_TARBALL="${OPTARG}"
            ;;
          ?)
            exit_error "invalid argument: ${OPTARG}"
            ;;
        esac
      done
      shift $((OPTIND - 1))
    
      check_requirements || exit 1
    
      ${CMD} -v "${DATA_DIR}:${MUST_GATHER_VOL}:z" "${NTO_IMG}" "$@" --must-gather-dir-path "${MUST_GATHER_VOL}"
      echo "" 1>&2
    }
    
    main "$@"
  3. 为这个脚本中的每个人添加执行权限:

    $ chmod a+x run-perf-profile-creator.sh
  4. 运行以下命令,使用 Podman 向 registry.redhat.io 进行身份验证:

    $ podman login registry.redhat.io
    Username: <user_name>
    Password: <password>
  5. 可选:运行以下命令来显示 PPC 工具的帮助信息:

    $ ./run-perf-profile-creator.sh -h

    输出示例

    Wrapper usage:
      run-perf-profile-creator.sh [-h] [-p image][-t path] -- [performance-profile-creator flags]
    
    Options:
       -h                 help for run-perf-profile-creator.sh
       -p                 Node Tuning Operator image
       -t                 path to a must-gather tarball
    A tool that automates creation of Performance Profiles
    
    Usage:
      performance-profile-creator [flags]
    
    Flags:
          --disable-ht                        Disable Hyperthreading
      -h, --help                              help for performance-profile-creator
          --info string                       Show cluster information; requires --must-gather-dir-path, ignore the other arguments. [Valid values: log, json] (default "log")
          --mcp-name string                   MCP name corresponding to the target machines (required)
          --must-gather-dir-path string       Must gather directory path (default "must-gather")
          --offlined-cpu-count int            Number of offlined CPUs
          --per-pod-power-management          Enable Per Pod Power Management
          --power-consumption-mode string     The power consumption mode.  [Valid values: default, low-latency, ultra-low-latency] (default "default")
          --profile-name string               Name of the performance profile to be created (default "performance")
          --reserved-cpu-count int            Number of reserved CPUs (required)
          --rt-kernel                         Enable Real Time Kernel (required)
          --split-reserved-cpus-across-numa   Split the Reserved CPUs across NUMA nodes
          --topology-manager-policy string    Kubelet Topology Manager Policy of the performance profile to be created. [Valid values: single-numa-node, best-effort, restricted] (default "restricted")
          --user-level-networking             Run with User level Networking(DPDK) enabled

    注意

    您可以选择使用 -p 选项为 Node Tuning Operator 镜像设置路径。如果您没有设置路径,wrapper 脚本使用默认镜像: registry.redhat.io/openshift4/ose-cluster-node-tuning-rhel9-operator:v4.14

  6. 要显示集群的信息,请运行以下命令使用 log 参数运行 PPC 工具:

    $ ./run-perf-profile-creator.sh -t /<path_to_must_gather_dir>/must-gather.tar.gz -- --info=log
    • -t /<path_to_must_gather_dir>/must-gather.tar.gz 指定包含 must-gather tarball 的目录的路径。这是 wrapper 脚本的必要参数。

      输出示例

      level=info msg="Cluster info:"
      level=info msg="MCP 'master' nodes:"
      level=info msg=---
      level=info msg="MCP 'worker' nodes:"
      level=info msg="Node: host.example.com (NUMA cells: 1, HT: true)"
      level=info msg="NUMA cell 0 : [0 1 2 3]"
      level=info msg="CPU(s): 4"
      level=info msg="Node: host1.example.com (NUMA cells: 1, HT: true)"
      level=info msg="NUMA cell 0 : [0 1 2 3]"
      level=info msg="CPU(s): 4"
      level=info msg=---
      level=info msg="MCP 'worker-cnf' nodes:"
      level=info msg="Node: host2.example.com (NUMA cells: 1, HT: true)"
      level=info msg="NUMA cell 0 : [0 1 2 3]"
      level=info msg="CPU(s): 4"
      level=info msg=---

  7. 运行以下命令来创建性能配置集。

    $ ./run-perf-profile-creator.sh -t /path-to-must-gather/must-gather.tar.gz -- --mcp-name=worker-cnf --reserved-cpu-count=1 --rt-kernel=true --split-reserved-cpus-across-numa=false --power-consumption-mode=ultra-low-latency --offlined-cpu-count=1 > my-performance-profile.yaml

    本例使用示例 PPC 参数和值。

    • --mcp-name=worker-cnf 指定 worker-=cnf 机器配置池。
    • --reserved-cpu-count=1 指定一个保留 CPU。
    • --rt-kernel=true 启用实时内核。
    • --split-reserved-cpus-across-numa=false 禁用跨 NUMA 节点的保留 CPU 分割。
    • --power-consumption-mode=ultra-low-latency 指定最大延迟,这会增加功耗。
    • --offlined-cpu-count=1 指定一个离线 CPU。

      注意

      本例中的 mcp-name 参数根据 oc get mcp 命令的输出设置为 worker-cnf。对于单节点 OpenShift,请使用 --mcp-name=master

  8. 运行以下命令,查看创建的 YAML 文件:

    $ cat my-performance-profile.yaml

    输出示例

    ---
    apiVersion: performance.openshift.io/v2
    kind: PerformanceProfile
    metadata:
      name: performance
    spec:
      cpu:
        isolated: 2-3
        offlined: "1"
        reserved: "0"
      machineConfigPoolSelector:
        machineconfiguration.openshift.io/role: worker-cnf
      nodeSelector:
        node-role.kubernetes.io/worker-cnf: ""
      numa:
        topologyPolicy: restricted
      realTimeKernel:
        enabled: true
      workloadHints:
        highPowerConsumption: true
        perPodPowerManagement: false
        realTime: true

  9. 应用生成的配置集:

    $ oc apply -f my-performance-profile.yaml

    输出示例

    performanceprofile.performance.openshift.io/performance created

15.1.6. Performance Profile Creator 参数

表 15.1. 所需的 Performance Profile Creator 参数
参数描述

mcp-name

MCP 的名称;例如,与目标机器对应的 worker-cnf

must-gather-dir-path

must gather 目录的路径。

只有在使用 Podman 运行 PPC 工具时才需要此参数。如果您将 PPC 与 wrapper 脚本搭配使用,请不要使用此参数。反之,使用 wrapper 脚本的 -t 选项指定 must-gather tarball 的目录路径。

reserved-cpu-count

保留 CPU 的数量。使用大于零的一个自然数字。

rt-kernel

启用实时内核。

可能的值: truefalse

表 15.2. 可选的 Performance Profile Creator 参数
参数描述

disable-ht

禁用超线程。

可能的值: truefalse

默认值: false

警告

如果此参数设为 true,则不应在 BIOS 中禁用 Hyper-Threading。禁用超线程通过内核命令行参数来完成。

info

这会捕获集群信息。这个参数还需要 must-gather-dir-path 参数。如果设置了任何其他参数,则忽略它们。

可能的值:

  • log
  • JSON

默认: log

offlined-cpu-count

离线 CPU 数量。

注意

使用大于零的一个自然数字。如果没有足够的逻辑处理器离线,则会记录错误消息。信息是:

Error: failed to compute the reserved and isolated CPUs: please ensure that reserved-cpu-count plus offlined-cpu-count should be in the range [0,1]
Error: failed to compute the reserved and isolated CPUs: please specify the offlined CPU count in the range [0,1]

power-consumption-mode

电源功耗模式。

可能的值:

  • default :仅通过 CPU 分区实现的性能。
  • low-latency: 增强的测量功能以改进延迟。
  • ultra-low-latency: 优先实现最好的延迟性能(以增加电源管理费用为代价)。

默认: default

per-pod-power-management

为每个 pod 电源管理启用。如果您将 ultra-low-latency 配置为功耗模式,则无法使用此参数。

可能的值: truefalse

默认值: false

profile-name

要创建的性能配置集的名称。

默认:performance.

split-reserved-cpus-across-numa

将保留的 CPU 划分到 NUMA 节点。

可能的值: truefalse

默认值: false

topology-manager-policy

要创建的性能配置集的 kubelet Topology Manager 策略。

可能的值:

  • single-numa-node
  • best-effort
  • restricted

默认: restricted

user-level-networking

在启用了用户级别网络(DPDK)的情况下运行。

可能的值: truefalse

默认值: false

15.1.7. 参考性能配置集

使用以下引用性能配置集作为开发您自己的自定义配置集的基础。

15.1.7.1. 在 OpenStack 上使用 OVS-DPDK 的集群的性能配置集模板

要最大化使用 Open vSwitch 和 Red Hat OpenStack Platform(RHOSP)上的 Data Plane Development Kit(OVS-DPDK)的机器性能,您可以使用性能配置集。

您可以使用以下性能配置集模板为您的部署创建配置集。

使用 OVS-DPDK 的集群的性能配置集模板

apiVersion: performance.openshift.io/v2
kind: PerformanceProfile
metadata:
  name: cnf-performanceprofile
spec:
  additionalKernelArgs:
    - nmi_watchdog=0
    - audit=0
    - mce=off
    - processor.max_cstate=1
    - idle=poll
    - intel_idle.max_cstate=0
    - default_hugepagesz=1GB
    - hugepagesz=1G
    - intel_iommu=on
  cpu:
    isolated: <CPU_ISOLATED>
    reserved: <CPU_RESERVED>
  hugepages:
    defaultHugepagesSize: 1G
    pages:
      - count: <HUGEPAGES_COUNT>
        node: 0
        size: 1G
  nodeSelector:
    node-role.kubernetes.io/worker: ''
  realTimeKernel:
    enabled: false
    globallyDisableIrqLoadBalancing: true

插入适用于 CPU_ISOLATEDCPU_RESERVEDHUGEPAGES_COUNT 密钥的配置的值。

15.1.7.2. Telco RAN DU 参考设计性能配置集

以下性能配置集在商业硬件上配置 OpenShift Container Platform 集群的节点级性能设置,以托管电信 RAN DU 工作负载。

Telco RAN DU 参考设计性能配置集

apiVersion: performance.openshift.io/v2
kind: PerformanceProfile
metadata:
  # if you change this name make sure the 'include' line in TunedPerformancePatch.yaml
  # matches this name: include=openshift-node-performance-${PerformanceProfile.metadata.name}
  # Also in file 'validatorCRs/informDuValidator.yaml':
  # name: 50-performance-${PerformanceProfile.metadata.name}
  name: openshift-node-performance-profile
  annotations:
    ran.openshift.io/reference-configuration: "ran-du.redhat.com"
spec:
  additionalKernelArgs:
    - "rcupdate.rcu_normal_after_boot=0"
    - "efi=runtime"
    - "vfio_pci.enable_sriov=1"
    - "vfio_pci.disable_idle_d3=1"
    - "module_blacklist=irdma"
  cpu:
    isolated: $isolated
    reserved: $reserved
  hugepages:
    defaultHugepagesSize: $defaultHugepagesSize
    pages:
      - size: $size
        count: $count
        node: $node
  machineConfigPoolSelector:
    pools.operator.machineconfiguration.openshift.io/$mcp: ""
  nodeSelector:
    node-role.kubernetes.io/$mcp: ""
  numa:
    topologyPolicy: "restricted"
  # To use the standard (non-realtime) kernel, set enabled to false
  realTimeKernel:
    enabled: true
  workloadHints:
    # WorkloadHints defines the set of upper level flags for different type of workloads.
    # See https://github.com/openshift/cluster-node-tuning-operator/blob/master/docs/performanceprofile/performance_profile.md#workloadhints
    # for detailed descriptions of each item.
    # The configuration below is set for a low latency, performance mode.
    realTime: true
    highPowerConsumption: false
    perPodPowerManagement: false

15.1.7.3. 电信核心参考设计性能配置集

以下性能配置集在商业硬件上为 OpenShift Container Platform 集群配置节点级别的性能设置,以托管电信核心工作负载。

电信核心参考设计性能配置集

apiVersion: performance.openshift.io/v2
kind: PerformanceProfile
metadata:
  # if you change this name make sure the 'include' line in TunedPerformancePatch.yaml
  # matches this name: include=openshift-node-performance-${PerformanceProfile.metadata.name}
  # Also in file 'validatorCRs/informDuValidator.yaml':
  # name: 50-performance-${PerformanceProfile.metadata.name}
  name: openshift-node-performance-profile
  annotations:
    ran.openshift.io/reference-configuration: "ran-du.redhat.com"
spec:
  additionalKernelArgs:
    - "rcupdate.rcu_normal_after_boot=0"
    - "efi=runtime"
    - "vfio_pci.enable_sriov=1"
    - "vfio_pci.disable_idle_d3=1"
    - "module_blacklist=irdma"
  cpu:
    isolated: $isolated
    reserved: $reserved
  hugepages:
    defaultHugepagesSize: $defaultHugepagesSize
    pages:
      - size: $size
        count: $count
        node: $node
  machineConfigPoolSelector:
    pools.operator.machineconfiguration.openshift.io/$mcp: ""
  nodeSelector:
    node-role.kubernetes.io/$mcp: ""
  numa:
    topologyPolicy: "restricted"
  # To use the standard (non-realtime) kernel, set enabled to false
  realTimeKernel:
    enabled: true
  workloadHints:
    # WorkloadHints defines the set of upper level flags for different type of workloads.
    # See https://github.com/openshift/cluster-node-tuning-operator/blob/master/docs/performanceprofile/performance_profile.md#workloadhints
    # for detailed descriptions of each item.
    # The configuration below is set for a low latency, performance mode.
    realTime: true
    highPowerConsumption: false
    perPodPowerManagement: false

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.