Prepare a MicroShift workload for low latency
To use low latency, configure pod annotations to set the microshift-low-latency container runtime configuration for your workloads by using the RuntimeClass feature.
-
You installed the
microshift-low-latencyRPM package. -
You configured workload partitioning.
-
Use the following example to set the following annotations in the pod spec:
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
oslattest:apiVersion: v1 kind: Pod metadata: name: oslat annotations: cpu-load-balancing.crio.io: "disable" irq-load-balancing.crio.io: "disable" cpu-quota.crio.io: "disable" cpu-c-states.crio.io: "disable" cpu-freq-governor.crio.io: "<governor>" spec: runtimeClassName: microshift-low-latency 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_LOCKmetadata.annotations.cpu-load-balancing.crio.io-
Disables the CPU load balancing for the pod.
metadata.annotations.irq-load-balancing.crio.io-
Opts the pod out of interrupt handling (IRQ).
metadata.annotations.cpu-quota.crio.io-
Disables the CPU completely fair scheduler (CFS) quota at the pod run time.
metadata.annotations.cpu-c-states.crio.io-
Enables or disables C-states for each CPU. Set the value to
disableto provide the best performance for a high-priority pod. metadata.annotations.cpu-freq-governor.crio.io-
Sets the
cpufreqgovernor for each CPU. Theperformancegovernor is recommended for high-priority workloads. spec.runtimeClassName-
The
runtimeClassNamemust match the name of the performance profile configured in the node. For example,microshift-low-latency.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.
For the pod to have the
GuaranteedQoS class, it must have the same values of CPU and memory in requests and limits. See Guaranteed (Kubernetes upstream documentation)