From 3225e01c9ea38b5b453ffb4bf865da41e4addeef Mon Sep 17 00:00:00 2001 From: Alex Dellapenta Date: Mon, 29 Jul 2019 12:12:41 -0400 Subject: [PATCH] Fix hugepages node config --- modules/configuring-huge-pages.adoc | 71 +++++++++++++++++------------ 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/modules/configuring-huge-pages.adoc b/modules/configuring-huge-pages.adoc index a99cf23800..a87b1fd3e6 100644 --- a/modules/configuring-huge-pages.adoc +++ b/modules/configuring-huge-pages.adoc @@ -1,3 +1,7 @@ +// Module included in the following assemblies: +// +// * scalability_and_performance/what-huge-pages-do-and-how-they-are-consumed-by-apps.adoc + [id="configuring-huge-pages_{context}"] = Configuring huge pages @@ -10,46 +14,53 @@ Node Tuning Operator to allocate huge pages on a specific node. tuned profile, which describes how many huge pages should be allocated: + ---- -$ oc label node hugepages=true +$ oc label node hugepages=true ---- -. Create a tuned profile for this specific node and allocate some huge pages. To -associate the profile to the correct node, edit the tuned resource and add a -`profile` and `match` section: +. Create a file with the following content and name it `hugepages_tuning.yaml`: + ---- -$ oc edit tuned ----- +apiVersion: tuned.openshift.io/v1 +kind: Tuned +metadata: + name: hugepages <1> + namespace: openshift-cluster-node-tuning-operator +spec: + profile: <2> + - data: | + [main] + summary=Configuration for hugepages + include=openshift-node -.. In the `profile` section, add the following tuned profile for allocating huge -pages: + [vm] + transparent_hugepages=never + + [sysctl] + vm.nr_hugepages=1024 + name: node-hugepages + recommend: + - match: <3> + - label: hugepages + priority: 30 + profile: node-hugepages +---- +<1> Set the `name` parameter value to `hugepages`. +<2> Set the `profile` section to allocate huge pages. +<3> Set the `match` section to associate the profile to nodes with the `hugepages` label. + +. Create the custom `hugepages` tuned profile by using the `hugepages_tuning.yaml` file: + ---- -- data: | - [main] - summary=Configuration for hugepages - include=openshift-node - [vm] - transparent_hugepages=never - [sysctl] - vm.nr_hugepages=1024 +$ oc create -f hugepages_tuning.yaml ---- -.. To apply the profile to the correct node, add the following to the `match` -section: +. After creating the profile, the Operator applies the new profile to the correct +node and allocates huge pages. Check the logs of a tuned pod on a node using +huge pages to verify: + ---- - - match: - - label: hugepages - priority: 30 - profile: hugepages ----- - -The Operator applies the new profile to the correct node and allocates huge -pages: +$ oc logs \ + -n openshift-cluster-node-tuning-operator | grep 'applied$' | tail -n1 ----- -2019-04-30 13:38:26,831 INFO tuned.plugins.plugin_sysctl: reapplying system sysctl -2019-04-30 13:38:26,837 INFO tuned.daemon.daemon: static tuning from profile 'hugepages' applied -2019-04-30 13:38:26,845 INFO tuned.daemon.daemon: terminating Tuned +2019-08-08 07:20:41,286 INFO tuned.daemon.daemon: static tuning from profile 'node-hugepages' applied ----