Power Management and Performance in Enteprise Linux (EL7)

As with most things in Linux, there are an array of different tools and options available when dealing with the performance and power consumption of hardware components. Nevertheless, certain standard or even non-standard defaults always emerge, either distribution-specific or -agnostic. While a greater number of available tools provides greater control and more possible solutions, it also brings with it the possibility of greater potential for confusion and unclear incompatibilities.
One such confusion arose when I noticed the inconsistency in my CPU frequency preference across reboots. I was used to using the cpupower utility from the kernel-utils package; however, options in the configuration file in /etc/sysconfig/cpupower had no effect on the system during the boot up process. It turns out that RHEL7 and, by extension, Centos EL7 use the tuned utility by default for performance tuning. As a result, according to a forum post in the Centos forum,
...that service conflicts with cpupower. As far as I can tell cpupower gets completely ignored by systemd once tuned is enabled. So you can either disable tuned and use cuppower or forget about cpupower and stick with tuned.
Consequently, this post will briefly outline how to use the 'tuned' utility to configure the performance and power preferences on a RHEL7 system. The tuned project page has some useful information about the utility, of course.

Full documentation on the 'tuned' utility can be found in the Fedora Power Management Guide. The 'tuned' utility takes advantage of udev's dynamic device management capabilities to statically assign power/performance values through sysctl and sysfs settings to a various devices; including CPU, networking devices, disks, USB, audio, video, vm.
While the utility supports dynamic tuning as well, we won't concern ourselves with that feature here as it is disabled by default in EL7. Furthermore, according to the project's web page, dynamic tuning is experimental and limited in scope.
There are various profiles optimized for powersave, performance and virtual hosts/guests. You can view all available profiles with the following command:

# tuned-adm list
The profiles are held in the /usr/lib/tuned/ directory. The default profile is 'balanced'; if you want to switch to the e.g. powersave profile use:
# tuned-adm profile powersave
This setting is persistent across reboots. One can also create custom profiles that can either include and/or override settings from system profiles. Your custom profiles can be put into the /etc/tuned/ directory, and they have higher priority in case of conflict.
A caveat worth mentioning, as explained in Fedora's Power Management Docs:
The powersave profile may not always be the most efficient. Consider there is a defined amount of work that needs to be done, for example a video file that needs to be transcoded. Your machine can consume less energy if the transcoding is done on the full power, because the task will be finished quickly, the machine will start to idle and can automatically step-down to very efficient power save modes. On the other hand if you transcode the file with a throttled machine, the machine will consume less power during the transcoding, but the process will take longer and the overall consumed energy can be higher. That is why the balanced profile can be generally a better option.

NOTE

According to a blog post on Red Hat's developer blog, the default profile on RHEL7 for tuned is throughput-performance, not balanced.

Popular posts from this blog

Password Policy in RHEL 7

Centos 7 pulseaudio

wpa_supplicant and wifi in RHEL 7