Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 16. Creating a performance profile
Learn about the Performance Profile Creator (PPC) and how you can use it to create a performance profile.
Currently, disabling CPU load balancing is not supported by cgroup v2. As a result, you might not get the desired behavior from performance profiles if you have cgroup v2 enabled. Enabling cgroup v2 is not recommended if you are using performance profiles.
16.1. About the Performance Profile Creator Link kopierenLink in die Zwischenablage kopiert!
The Performance Profile Creator (PPC) is a command-line tool, delivered with the Node Tuning Operator, used to create the performance profile. The tool consumes
must-gather
The tool is run by one of the following methods:
-
Invoking
podman - Calling a wrapper script
16.1.1. Gathering data about your cluster using the must-gather command Link kopierenLink in die Zwischenablage kopiert!
The Performance Profile Creator (PPC) tool requires
must-gather
must-gather
In earlier versions of OpenShift Container Platform, the Performance Addon Operator provided automatic, low latency performance tuning for applications. In OpenShift Container Platform 4.11 and later, this functionality is part of the Node Tuning Operator. However, you must still use the
performance-addon-operator-must-gather
must-gather
Prerequisites
-
Access to the cluster as a user with the role.
cluster-admin -
Access to the Performance Addon Operator image.
must gather -
The OpenShift CLI () installed.
oc
Procedure
Optional: Verify that a matching machine config pool exists with a label:
$ oc describe mcp/worker-rtExample output
Name: worker-rt Namespace: Labels: machineconfiguration.openshift.io/role=worker-rtIf a matching label does not exist add a label for a machine config pool (MCP) that matches with the MCP name:
$ oc label mcp <mcp_name> machineconfiguration.openshift.io/role=<mcp_name>-
Navigate to the directory where you want to store the data.
must-gather Run
on your cluster:must-gather$ oc adm must-gather --image=<PAO_must_gather_image> --dest-dir=<dir>NoteThe
command must be run with themust-gatherimage. The output can optionally be compressed. Compressed output is required if you are running the Performance Profile Creator wrapper script.performance-addon-operator-must-gatherExample
$ oc adm must-gather --image=registry.redhat.io/openshift4/performance-addon-operator-must-gather-rhel8:v4.12 --dest-dir=<path_to_must-gather>/must-gatherCreate a compressed file from the
directory:must-gather$ tar cvaf must-gather.tar.gz must-gather/
16.1.2. Running the Performance Profile Creator using podman Link kopierenLink in die Zwischenablage kopiert!
As a cluster administrator, you can run
podman
Prerequisites
-
Access to the cluster as a user with the role.
cluster-admin - A cluster installed on bare-metal hardware.
-
A node with and OpenShift CLI (
podman) installed.oc - Access to the Node Tuning Operator image.
Procedure
Check the machine config pool:
$ oc get mcpExample output
NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE master rendered-master-acd1358917e9f98cbdb599aea622d78b True False False 3 3 3 0 22h worker-cnf rendered-worker-cnf-1d871ac76e1951d32b2fe92369879826 False True False 2 1 1 0 22hUse Podman to authenticate to
:registry.redhat.io$ podman login registry.redhat.ioUsername: <username> Password: <password>Optional: Display help for the PPC tool:
$ podman run --rm --entrypoint performance-profile-creator registry.redhat.io/openshift4/ose-cluster-node-tuning-operator:v4.12 -hExample output
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) enabledRun the Performance Profile Creator tool in discovery mode:
NoteDiscovery mode inspects your cluster using the output from
. The output produced includes information on:must-gather- The NUMA cell partitioning with the allocated CPU ids
- Whether hyperthreading is enabled
Using this information you can set appropriate values for some of the arguments supplied to the Performance Profile Creator tool.
$ podman run --entrypoint performance-profile-creator -v <path_to_must-gather>/must-gather:/must-gather:z registry.redhat.io/openshift4/ose-cluster-node-tuning-operator:v4.12 --info log --must-gather-dir-path /must-gatherNoteThis command uses the performance profile creator as a new entry point to
. It maps thepodmandata for the host into the container image and invokes the required user-supplied profile arguments to produce themust-gatherfile.my-performance-profile.yamlThe
option can be the path to either:-v-
The output directory
must-gather -
An existing directory containing the decompressed tarball
must-gather
The
option requires a value which specifies the output format. Possible values are log and JSON. The JSON format is reserved for debugging.infoRun
:podman$ podman run --entrypoint performance-profile-creator -v /must-gather:/must-gather:z registry.redhat.io/openshift4/ose-cluster-node-tuning-operator:v4.12 --mcp-name=worker-cnf --reserved-cpu-count=4 --rt-kernel=true --split-reserved-cpus-across-numa=false --must-gather-dir-path /must-gather --power-consumption-mode=ultra-low-latency --offlined-cpu-count=6 > my-performance-profile.yamlNoteThe Performance Profile Creator arguments are shown in the Performance Profile Creator arguments table. The following arguments are required:
-
reserved-cpu-count -
mcp-name -
rt-kernel
The
argument in this example is set tomcp-namebased on the output of the commandworker-cnf. For single-node OpenShift useoc get mcp.--mcp-name=master-
Review the created YAML file:
$ cat my-performance-profile.yamlExample output
apiVersion: performance.openshift.io/v2 kind: PerformanceProfile metadata: name: performance spec: cpu: isolated: 2-39,48-79 offlined: 42-47 reserved: 0-1,40-41 machineConfigPoolSelector: machineconfiguration.openshift.io/role: worker-cnf nodeSelector: node-role.kubernetes.io/worker-cnf: "" numa: topologyPolicy: restricted realTimeKernel: enabled: true workloadHints: highPowerConsumption: true realTime: trueApply the generated profile:
$ oc apply -f my-performance-profile.yaml
16.1.2.1. How to run podman to create a performance profile Link kopierenLink in die Zwischenablage kopiert!
The following example illustrates how to run
podman
Node hardware configuration:
- 80 CPUs
- Hyperthreading enabled
- Two NUMA nodes
- Even numbered CPUs run on NUMA node 0 and odd numbered CPUs run on NUMA node 1
Run
podman
$ podman run --entrypoint performance-profile-creator -v /must-gather:/must-gather:z registry.redhat.io/openshift4/ose-cluster-node-tuning-operator:v4.12 --mcp-name=worker-cnf --reserved-cpu-count=20 --rt-kernel=true --split-reserved-cpus-across-numa=true --must-gather-dir-path /must-gather > my-performance-profile.yaml
The created profile is described in the following YAML:
apiVersion: performance.openshift.io/v2
kind: PerformanceProfile
metadata:
name: performance
spec:
cpu:
isolated: 10-39,50-79
reserved: 0-9,40-49
nodeSelector:
node-role.kubernetes.io/worker-cnf: ""
numa:
topologyPolicy: restricted
realTimeKernel:
enabled: true
In this case, 10 CPUs are reserved on NUMA node 0 and 10 are reserved on NUMA node 1.
16.1.3. Running the Performance Profile Creator wrapper script Link kopierenLink in die Zwischenablage kopiert!
The performance profile wrapper script simplifies the running of the Performance Profile Creator (PPC) tool. It hides the complexities associated with running
podman
Prerequisites
- Access to the Node Tuning Operator image.
-
Access to the tarball.
must-gather
Procedure
Create a file on your local machine named, for example,
:run-perf-profile-creator.sh$ vi run-perf-profile-creator.shPaste the following code into the file:
#!/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-operator:v4.12" 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 "$@"Add execute permissions for everyone on this script:
$ chmod a+x run-perf-profile-creator.shOptional: Display the
command usage:run-perf-profile-creator.sh$ ./run-perf-profile-creator.sh -hExpected output
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 image1 -t path to a must-gather tarball2 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) enabledNoteThere two types of arguments:
-
Wrapper arguments namely ,
-hand-p-t - PPC arguments
-
Wrapper arguments namely
Run the performance profile creator tool in discovery mode:
NoteDiscovery mode inspects your cluster using the output from
. The output produced includes information on:must-gather- The NUMA cell partitioning with the allocated CPU IDs
- Whether hyperthreading is enabled
Using this information you can set appropriate values for some of the arguments supplied to the Performance Profile Creator tool.
$ ./run-perf-profile-creator.sh -t /must-gather/must-gather.tar.gz -- --info=logNoteThe
option requires a value which specifies the output format. Possible values are log and JSON. The JSON format is reserved for debugging.infoCheck the machine config pool:
$ oc get mcpExample output
NAME CONFIG UPDATED UPDATING DEGRADED MACHINECOUNT READYMACHINECOUNT UPDATEDMACHINECOUNT DEGRADEDMACHINECOUNT AGE master rendered-master-acd1358917e9f98cbdb599aea622d78b True False False 3 3 3 0 22h worker-cnf rendered-worker-cnf-1d871ac76e1951d32b2fe92369879826 False True False 2 1 1 0 22hCreate a performance profile:
$ ./run-perf-profile-creator.sh -t /must-gather/must-gather.tar.gz -- --mcp-name=worker-cnf --reserved-cpu-count=2 --rt-kernel=true > my-performance-profile.yamlNoteThe Performance Profile Creator arguments are shown in the Performance Profile Creator arguments table. The following arguments are required:
-
reserved-cpu-count -
mcp-name -
rt-kernel
The
argument in this example is set tomcp-namebased on the output of the commandworker-cnf. For single-node OpenShift useoc get mcp.--mcp-name=master-
Review the created YAML file:
$ cat my-performance-profile.yamlExample output
apiVersion: performance.openshift.io/v2 kind: PerformanceProfile metadata: name: performance spec: cpu: isolated: 1-39,41-79 reserved: 0,40 nodeSelector: node-role.kubernetes.io/worker-cnf: "" numa: topologyPolicy: restricted realTimeKernel: enabled: falseApply the generated profile:
NoteInstall the Node Tuning Operator before applying the profile.
$ oc apply -f my-performance-profile.yaml
16.1.4. Performance Profile Creator arguments Link kopierenLink in die Zwischenablage kopiert!
| Argument | Description |
|---|---|
|
| Disable hyperthreading. Possible values:
Default:
Warning If this argument is set to
|
|
| This captures cluster information and is used in discovery mode only. Discovery mode also requires the
Possible values:
Default:
|
|
| MCP name for example
|
|
| Must gather directory path. This parameter is required. When the user runs the tool with the wrapper script
|
|
| Number of offlined CPUs. Note This must be a natural number greater than 0. If not enough logical processors are offlined then error messages are logged. The messages are:
|
|
| The power consumption mode. Possible values:
Default:
|
|
| Enable per pod power management. You cannot use this argument if you configured
Possible values:
Default:
|
|
| Name of the performance profile to create. Default:
|
|
| Number of reserved CPUs. This parameter is required. Note This must be a natural number. A value of 0 is not allowed. |
|
| Enable real-time kernel. This parameter is required. Possible values:
|
|
| Split the reserved CPUs across NUMA nodes. Possible values:
Default:
|
|
| Kubelet Topology Manager policy of the performance profile to be created. Possible values:
Default:
|
|
| Run with user level networking (DPDK) enabled. Possible values:
Default:
|
16.2. Reference performance profiles Link kopierenLink in die Zwischenablage kopiert!
16.2.1. A performance profile template for clusters that use OVS-DPDK on OpenStack Link kopierenLink in die Zwischenablage kopiert!
To maximize machine performance in a cluster that uses Open vSwitch with the Data Plane Development Kit (OVS-DPDK) on Red Hat OpenStack Platform (RHOSP), you can use a performance profile.
You can use the following performance profile template to create a profile for your deployment.
A performance profile template for clusters that use 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
Insert values that are appropriate for your configuration for the
CPU_ISOLATED
CPU_RESERVED
HUGEPAGES_COUNT
To learn how to create and use performance profiles, see the "Creating a performance profile" page in the "Scalability and performance" section of the OpenShift Container Platform documentation.