1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/microshift-low-latency-prepare-workload.adoc
2025-10-07 17:43:41 +00:00

95 lines
3.1 KiB
Plaintext

// Module included in the following assemblies:
//
// microshift_configuring/microshift_low_latency/microshift-low-latency.adoc
:_mod-docs-content-type: PROCEDURE
[id="microshift-low-latency-prepare-workload_{context}"]
= Preparing a {microshift-short} workload for low latency
To take advantage of low latency, workloads running on {microshift-short} must have the `microshift-low-latency` container runtime configuration set by using the `RuntimeClass` feature. The CRI-O `RuntimeClass` object is installed with the `microshift-low-latency` RPM, so only the pod annotations need to be configured.
.Prerequisites
* You installed the `microshift-low-latency` RPM package.
* You configured workload partitioning.
.Procedure
* Use the following example to set the following annotations in the pod spec:
+
[source,text]
----
cpu-load-balancing.crio.io: "disable"
irq-load-balancing.crio.io: "disable"
cpu-quota.crio.io: "disable"
cpu-load-balancing.crio.io: "disable"
cpu-freq-governor.crio.io: "<governor>"
----
+
.Example pod that runs `oslat` test:
+
[source,yaml]
----
apiVersion: v1
kind: Pod
metadata:
name: oslat
annotations:
cpu-load-balancing.crio.io: "disable" # <1>
irq-load-balancing.crio.io: "disable" # <2>
cpu-quota.crio.io: "disable" # <3>
cpu-c-states.crio.io: "disable" # <4>
cpu-freq-governor.crio.io: "<governor>" # <5>
spec:
runtimeClassName: microshift-low-latency # <6>
containers:
- name: oslat
image: quay.io/container-perf-tools/oslat
imagePullPolicy: Always
resources:
requests:
memory: "400Mi"
cpu: "2"
limits:
memory: "400Mi"
cpu: "2"
env:
- name: tool
value: "oslat"
- name: manual
value: "n"
- name: PRIO
value: "1"
- name: delay
value: "0"
- name: RUNTIME_SECONDS
value: "60"
- name: TRACE_THRESHOLD
value: ""
- name: EXTRA_ARGS
value: ""
securityContext:
privileged: true
capabilities:
add:
- SYS_NICE
- IPC_LOCK
----
<1> Disables the CPU load balancing for the pod.
<2> Opts the pod out of interrupt handling (IRQ).
<3> Disables the CPU completely fair scheduler (CFS) quota at the pod run time.
<4> Enables or disables C-states for each CPU. Set the value to `disable` to provide the best performance for a high-priority pod.
<5> Sets the `cpufreq` governor for each CPU. The `performance` governor is recommended for high-priority workloads.
<6> The `runtimeClassName` must match the name of the performance profile configured in the node. For example, `microshift-low-latency`.
+
[NOTE]
====
Disable CPU load balancing only when the CPU manager static policy is enabled and for pods with guaranteed QoS that use whole CPUs. Otherwise, disabling CPU load balancing can affect the performance of other containers in the node.
====
+
[IMPORTANT]
====
For the pod to have the `Guaranteed` QoS class, it must have the same values of CPU and memory in requests and limits. See link:https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/#guaranteed[Guaranteed] (Kubernetes upstream documentation)
====