Skip to content

Commit 5ea53bb

Browse files
committed
CNV-70994: Add CPU manager / pinning docs for CNV
1 parent 9527ad7 commit 5ea53bb

File tree

3 files changed

+89
-0
lines changed

3 files changed

+89
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4792,6 +4792,8 @@ Topics:
47924792
File: virt-post-install-network-config
47934793
- Name: Storage configuration
47944794
File: virt-post-install-storage-config
4795+
- Name: Performance optimization
4796+
File: virt-perf-optimization
47954797
- Name: Configuring higher VM workload density
47964798
File: virt-configuring-higher-vm-workload-density
47974799
- Name: Configuring certificate rotation
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/post_installation_configuration/virt-perf-optimization.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="virt-CPU-manager-policy_{context}"]
7+
= Configuring full physical cores for virtual machines
8+
9+
[role="_abstract"]
10+
As a cluster administrator, you can allocate a full physical core to a specific virtual machine (VM), instead of allowing different VMs to share the same physical core.
11+
Configuring your VMs to use only full physical cores can optimize performance for high-throughput or latency-critical VMs.
12+
13+
Allocating only full physical cores is important on simultaneous multi-threading (SMT) enabled systems because it offers the following benefits:
14+
15+
* Prevents noisy neighbors and resource contention
16+
* Mitigates performance degradation
17+
* Offers predictable latency
18+
* Guarantees exclusive CPU resources
19+
20+
You can configure full physical core allocation by modifying the `cpuManagerPolicy` and `cpuManagerPolicyOptions` settings in the `KubeletConfig` custom resource (CR).
21+
22+
.Prerequisites
23+
24+
* You have cluster administrator access to a {product-title} cluster with {VirtProductName} installed.
25+
* You have installed the {oc-first}.
26+
* You have enabled CPU Manager on the node where your VM runs.
27+
28+
.Procedure
29+
30+
. Edit the `KubeletConfig` CR to add the required `cpuManagerPolicy` and `cpuManagerPolicyOptions` configurations:
31+
+
32+
[source,yaml]
33+
----
34+
apiVersion: machineconfiguration.openshift.io/v1
35+
kind: KubeletConfig
36+
# ...
37+
cpuManagerPolicy: static
38+
cpuManagerPolicyOptions:
39+
full-pcpus-only: true
40+
kubeReserved:
41+
cpu: "1"
42+
# ...
43+
----
44+
+
45+
* You must set the `cpuManagerPolicy: static` policy to enable exclusive CPU allocation. This setting is a prerequisite for configuring the `cpuManagerPolicyOptions` settings.
46+
* You must set the `full-pcpus-only: true` policy option so that the static CPU Manager policy only allocates full physical cores.
47+
* You must reserve 1 CPU for the system by setting `cpu: "1"` in the `kubeReserved` settings. This ensures that the cluster remains stable, by requiring that the system's core functions always have access to the CPU that they need to work correctly.
48+
49+
. Run the following command to apply the changes to the `KubeletConfig` CR:
50+
+
51+
[source,terminal]
52+
----
53+
$ oc apply -f <filename>.yaml
54+
----
55+
56+
.Verification
57+
58+
* Inspect the kubelet configuration on a node where the change you applied the change, by running the following command and inspecting the output:
59+
+
60+
[source,terminal]
61+
----
62+
$ oc debug node/<node_name> -- chroot /host cat /etc/kubernetes/kubelet.conf | grep -E -A 2 'cpuManagerPolicy|kubeReserved'
63+
----
64+
+
65+
Example output:
66+
+
67+
[source,YAML]
68+
----
69+
cpuManagerPolicy: static
70+
cpuManagerPolicyOptions:
71+
full-pcpus-only: true
72+
--
73+
kubeReserved:
74+
cpu: "1"
75+
----
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
include::_attributes/common-attributes.adoc[]
3+
[id="virt-perf-optimization"]
4+
= Performance optimization
5+
:context: virt-perf-optimization
6+
7+
toc::[]
8+
9+
[role="_abstract"]
10+
You can modify certain configurations for your {VirtProductName} deployment to improve efficiency, cost-effectiveness, and reliability.
11+
12+
include::modules/virt-CPU-manager-policy.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)