Skip to content

Commit 774a76c

Browse files
authored
Merge pull request #56865 from kquinn1204/TELCODOCS-646
TELCODOCS-646 PR for configure power savings states
2 parents bd9f0fc + 16c8521 commit 774a76c

7 files changed

+248
-1
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * scalability_and_performance/ztp_far_edge/ztp-advanced-policy-config.adoc
4+
5+
:_module-type: PROCEDURE
6+
[id="ztp-using-pgt-to-configure-high-performance-mode_{context}"]
7+
= Configuring high-performance mode using PolicyGenTemplate CRs
8+
9+
Follow this example to set high performance mode by updating the `workloadHints` fields in the generated `PerformanceProfile` CR for the reference configuration, based on the `PolicyGenTemplate` CR in the `group-du-sno-ranGen.yaml`.
10+
11+
High performance mode provides ultra low latency at the highest power consumption.
12+
13+
.Prerequisites
14+
15+
* You have configured the BIOS with performance related settings by following the guidance in "Configuring host firmware for low latency and high performance".
16+
17+
.Procedure
18+
19+
. Update the `PolicyGenTemplate` entry for `PerformanceProfile` in the `group-du-sno-ranGen.yaml` reference file in `out/argocd/example/policygentemplates` as follows to set high-performance mode.
20+
+
21+
[source,yaml]
22+
----
23+
- fileName: PerformanceProfile.yaml
24+
policyName: "config-policy"
25+
metadata:
26+
[...]
27+
spec:
28+
[...]
29+
workloadHints:
30+
realTime: true
31+
highPowerConsumption: true
32+
perPodPowerManagement: false
33+
----
34+
35+
. Commit the `PolicyGenTemplate` change in Git, and then push to the Git repository being monitored by the GitOps ZTP Argo CD application.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * scalability_and_performance/ztp_far_edge/ztp-advanced-policy-config.adoc
4+
5+
:_module-type: PROCEDURE
6+
[id="ztp-using-pgt-to-configure-performance-mode_{context}"]
7+
= Configuring performance mode using PolicyGenTemplate CRs
8+
9+
Follow this example to set performance mode by updating the `workloadHints` fields in the generated `PerformanceProfile` CR for the reference configuration, based on the `PolicyGenTemplate` CR in the `group-du-sno-ranGen.yaml`.
10+
11+
Performance mode provides low latency at a relatively high power consumption.
12+
13+
.Prerequisites
14+
15+
* You have configured the BIOS with performance related settings by following the guidance in "Configuring host firmware for low latency and high performance".
16+
17+
.Procedure
18+
19+
. Update the `PolicyGenTemplate` entry for `PerformanceProfile` in the `group-du-sno-ranGen.yaml` reference file in `out/argocd/example/policygentemplates` as follows to set performance mode.
20+
+
21+
[source,yaml]
22+
----
23+
- fileName: PerformanceProfile.yaml
24+
policyName: "config-policy"
25+
metadata:
26+
[...]
27+
spec:
28+
[...]
29+
workloadHints:
30+
realTime: true
31+
highPowerConsumption: false
32+
perPodPowerManagement: false
33+
----
34+
35+
. Commit the `PolicyGenTemplate` change in Git, and then push to the Git repository being monitored by the GitOps ZTP Argo CD application.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * scalability_and_performance/ztp_far_edge/ztp-advanced-policy-config.adoc
4+
5+
:_module-type: PROCEDURE
6+
[id="ztp-using-pgt-to-configure-power-saving-mode_{context}"]
7+
= Configuring power saving mode using PolicyGenTemplate CRs
8+
9+
Follow this example to set power saving mode by updating the `workloadHints` fields in the generated `PerformanceProfile` CR for the reference configuration, based on the `PolicyGenTemplate` CR in the `group-du-sno-ranGen.yaml`.
10+
11+
The power saving mode balances reduced power consumption with increased latency.
12+
13+
.Prerequisites
14+
15+
* You enabled C-states and OS-controlled P-states in the BIOS.
16+
17+
.Procedure
18+
19+
. Update the `PolicyGenTemplate` entry for `PerformanceProfile` in the `group-du-sno-ranGen.yaml` reference file in `out/argocd/example/policygentemplates` as follows to configure power saving mode. It is recommended to configure the CPU governor for the power saving mode through the additional kernel arguments object.
20+
+
21+
[source,yaml]
22+
----
23+
- fileName: PerformanceProfile.yaml
24+
policyName: "config-policy"
25+
metadata:
26+
[...]
27+
spec:
28+
[...]
29+
workloadHints:
30+
realTime: true
31+
highPowerConsumption: false
32+
perPodPowerManagement: true
33+
[...]
34+
additionalKernelArgs:
35+
- [...]
36+
- "cpufreq.default_governor=schedutil" <1>
37+
----
38+
<1> The `schedutil` governor is recommended, however, other governors that can be used include `ondemand` and `powersave`.
39+
40+
. Commit the `PolicyGenTemplate` change in Git, and then push to the Git repository being monitored by the GitOps ZTP Argo CD application.
41+
42+
.Verification
43+
44+
. Select a worker node in your deployed cluster from the list of nodes identified by using the following command:
45+
+
46+
[source,terminal]
47+
----
48+
$ oc get nodes
49+
----
50+
51+
. Log in to the node by using the following command:
52+
+
53+
[source,terminal]
54+
----
55+
$ oc debug node/<node-name>
56+
----
57+
+
58+
Replace `<node-name>` with the name of the node you want to verify the power state on.
59+
60+
. Set `/host` as the root directory within the debug shell. The debug pod mounts the host’s root file system in `/host` within the pod. By changing the root directory to `/host`, you can run binaries contained in the host’s executable paths as shown in the following example:
61+
+
62+
[source,terminal]
63+
----
64+
# chroot /host
65+
----
66+
67+
. Run the following command to verify the applied power state:
68+
+
69+
[source,terminal]
70+
----
71+
# cat /proc/cmdline
72+
----
73+
74+
.Expected output
75+
76+
* For power saving mode the `intel_pstate=passive`.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * scalability_and_performance/ztp_far_edge/ztp-advanced-policy-config.adoc
4+
5+
:_module-type: CONCEPT
6+
7+
[id="ztp-using-pgt-to-configure-power-saving-states_{context}"]
8+
= Configuring power states using PolicyGenTemplates CRs
9+
10+
For low latency and high-performance edge deployments, it is necessary to disable or limit C-states and P-states.
11+
With this configuration, the CPU runs at a constant frequency, which is typically the maximum turbo frequency. This ensures that the CPU is always running at its maximum speed, which results in high performance and low latency.
12+
This leads to the best latency for workloads.
13+
However, this also leads to the highest power consumption, which might not be necessary for all workloads.
14+
15+
Workloads can be classified as critical or non-critical, with critical workloads requiring disabled C-state and P-state settings for high performance and low latency, while non-critical workloads use C-state and P-state settings for power savings at the expense of some latency and performance. You can configure the following three power states using zero touch provisioning (ZTP):
16+
17+
* High-performance mode provides ultra low latency at the highest power consumption.
18+
* Performance mode provides low latency at a relatively high power consumption.
19+
* Power saving balances reduced power consumption with increased latency.
20+
21+
The default configuration is for a low latency, performance mode.
22+
23+
`PolicyGenTemplate` custom resources (CRs) allow you to overlay additional configuration details onto the base source CRs provided with the GitOps plugin in the `ztp-site-generate` container.
24+
25+
Configure the power states by updating the `workloadHints` fields in the generated `PerformanceProfile` CR for the reference configuration, based on the `PolicyGenTemplate` CR in the `group-du-sno-ranGen.yaml`.
26+
27+
The following common prerequisites apply to configuring all three power states.
28+
29+
.Prerequisites
30+
31+
* You have created a Git repository where you manage your custom site configuration data. The repository must be accessible from the hub cluster and be defined as a source repository for Argo CD.
32+
33+
* You have followed the procedure described in "Preparing the GitOps ZTP site configuration repository".
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * scalability_and_performance/ztp_far_edge/ztp-advanced-policy-config.adoc
4+
5+
:_module-type: PROCEDURE
6+
[id="ztp-using-pgt-to-maximize-power-savings-mode_{context}"]
7+
= Maximizing power savings
8+
9+
Limiting the maximum CPU frequency is recommended to achieve maximum power savings.
10+
Enabling C-states on the non-critical workload CPUs without restricting the maximum CPU frequency negates much of the power savings by boosting the frequency of the critical CPUs.
11+
12+
Maximize power savings by updating the `sysfs` plugin fields, setting an appropriate value for `max_perf_pct` in the `TunedPerformancePatch` CR for the reference configuration. This example based on the `group-du-sno-ranGen.yaml` describes the procedure to follow to restrict the maximum CPU frequency.
13+
14+
.Prerequisites
15+
16+
* You have configured power savings mode as described in "Using PolicyGenTemplate CRs to configure power savings mode".
17+
18+
.Procedure
19+
20+
. Update the `PolicyGenTemplate` entry for `TunedPerformancePatch` in the `group-du-sno-ranGen.yaml` reference file in `out/argocd/example/policygentemplates`. To maximize power savings, add `max_perf_pct` as shown in the following example:
21+
+
22+
[source,yaml]
23+
----
24+
- fileName: TunedPerformancePatch.yaml
25+
policyName: "config-policy"
26+
spec:
27+
profile:
28+
- name: performance-patch
29+
data: |
30+
[...]
31+
[sysfs]
32+
/sys/devices/system/cpu/intel_pstate/max_perf_pct=<x> <1>
33+
----
34+
+
35+
<1> The `max_perf_pct` controls the maximum frequency the `cpufreq` driver is allowed to set as a percentage of the maximum supported CPU frequency. This value applies to all CPUs. You can check the maximum supported frequency in `/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`. As a starting point, you can use a percentage that caps all CPUs at the `All Cores Turbo` frequency. The `All Cores Turbo` frequency is the frequency that all cores will run at when the cores are all fully occupied.
36+
+
37+
[NOTE]
38+
====
39+
To maximize power savings, set a lower value. Setting a lower value for `max_perf_pct` limits the maximum CPU frequency, thereby reducing power consumption, but also potentially impacting performance. Experiment with different values and monitor the system's performance and power consumption to find the optimal setting for your use-case.
40+
====
41+
42+
. Commit the `PolicyGenTemplate` change in Git, and then push to the Git repository being monitored by the GitOps ZTP Argo CD application.

modules/ztp-using-pgt-to-update-source-crs.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,4 @@ spec:
147147
----
148148
149149
The `policyGen` tool replace instances of `$mcp` with `worker` in the output CRs.
150-
====
150+
====

scalability_and_performance/ztp_far_edge/ztp-advanced-policy-config.adoc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,32 @@ include::modules/ztp-creating-a-validator-inform-policy.adoc[leveloffset=+1]
3333

3434
* xref:../../scalability_and_performance/ztp_far_edge/ztp-updating-gitops.adoc#ztp-updating-gitops[Upgrading GitOps ZTP]
3535
36+
include::modules/ztp-using-pgt-to-configure-power-states.adoc[leveloffset=+1]
37+
38+
[role="_additional-resources"]
39+
.Additional resources
40+
41+
* xref::../../../../scalability_and_performance/cnf-low-latency-tuning.html#cnf-understanding-workload-hints_cnf-master[Understanding workload hints]
42+
43+
* xref::../../../../scalability_and_performance/cnf-low-latency-tuning.html#configuring-workload-hints_cnf-master[Configuring workload hints manually]
44+
45+
include::modules/ztp-using-pgt-to-configure-performance-mode.adoc[leveloffset=+2]
46+
47+
include::modules/ztp-using-pgt-to-configure-high-performance-mode.adoc[leveloffset=+2]
48+
49+
include::modules/ztp-using-pgt-to-configure-power-saving-mode.adoc[leveloffset=+2]
50+
51+
[role="_additional-resources"]
52+
.Additional resources
53+
54+
* xref::../../../../scalability_and_performance/cnf-low-latency-tuning.html#node-tuning-operator-pod-power-saving-config_cnf-master[Enabling critical workloads for power saving configurations]
55+
56+
* xref::../../../../scalability_and_performance/ztp_far_edge/ztp-reference-cluster-configuration-for-vdu.html#ztp-du-configuring-host-firmware-requirements_sno-configure-for-vdu[Configuring host firmware for low latency and high performance]
57+
58+
* xref::../../../../scalability_and_performance/ztp_far_edge/ztp-preparing-the-hub-cluster.html#ztp-preparing-the-ztp-git-repository_ztp-preparing-the-hub-cluster[Preparing the GitOps ZTP site configuration repository]
59+
60+
include::modules/ztp-using-pgt-to-maximize-power-saving-mode.adoc[leveloffset=+2]
61+
3662
include::modules/ztp-configuring-ptp-fast-events.adoc[leveloffset=+1]
3763

3864
[role="_additional-resources"]

0 commit comments

Comments
 (0)