5 Working With Tuned

WARNING:

Oracle Linux 7 is now in Extended Support. See Oracle Linux Extended Support and Oracle Open Source Support Policies for more information.

Migrate applications and data to Oracle Linux 8 or Oracle Linux 9 as soon as possible.

This chapter describes the Tuned monitoring tool and Tuned profiles . The chapter also includes tasks for using Tuned to optimize performance on your Oracle Linux systems.

About Tuned

The Tuned system tuning tool is used to monitor the system to optimize its performance under certain conditions. The Tuned tool uses the udev device manager to monitor connected devices, enabling both static and dynamic tuning of your system's settings. Note that dynamic tuning is turned off by default in this release. To enable dynamic tuning, see About Static and Dynamic Tuning in Tuned.

Tuned uses several predefined profiles to tune your system. The profiles that are provided are designed for particular use cases and fall into one of the following two categories: power-saving profiles and performance-boosting profiles. Performance-boosting profiles address low latency and high throughput for storage and the network and virtualization host performance.

Based on the product that is currently in use, a default profile is automatically set. You can use the tuned-adm recommend command to determine which profile is recommended for a particular product. Note that if no recommendation is available, the balanced profile is set.

You can modify the rules that are defined for each profile, as well as customize how a specific device is tuned by using a specific profile. In addition, you can configure Tuned so that any changes in device usage triggers an adjustment in the current settings so that the performance of active devices is improved and power consumption for inactive devices is reduced.

About Tuned Profiles

The following Tuned profiles are typically installed by default in Oracle Linux 7 or can be installed from a separate package:

  • balanced (default profile): Is a power-saving profile. This profile provides a balance between performance and power consumption. The profile uses auto-scaling and auto-tuning when possible. A possible drawback is increased latency.

  • powersave: Is a profile that provides maximum power saving performance. The profile can minimize actual power consumption by throttling performance.

    Note:

    In some instances, the balanced profile is a better choice than the powersave profile, as it is more efficient.

  • throughput-performance (default profile): Is a server profile that is optimized for high throughput. The profile disables power-savings mechanisms and enables sysctl settings to improve the throughput performance of the disk and network IO.

  • latency-performance: Is a server profile that is optimized for low latency. The profile disables power-savings mechanisms and enables sysctl settings to improve latency.

  • network-latency: Is a profile that provides low latency network tuning and is based on the latency-performance profile. In addition, this profile disables transparent huge pages and NUMA balancing and tunes several network-related sysctl settings.

  • network-throughput: A profile for throughput network tuning. It is based on the throughput-performance profile. In addition, this profile increases kernel network buffers.

  • virtual-guest (default profile): Is a profile that is designed for virtual guests and is based on the throughput-performance profile. This profile decreases virtual memory swappiness and increases disk readahead values.

  • virtual-host: Is a profile that is designed for virtual hosts and is based on the throughput-performance profile. This profile decreases virtual memory swappiness, increases disk readahead values, and enables a more aggressive value of dirty pages writeback.

  • desktop: Is a profile that is optimized for desktop environments and is based on the balanced profile. In addition, this profile enables scheduler autogroups for better response of interactive applications.

Note:

You can install additional profiles to better match your system configuration and intended use case. For example, if you are using a real-time kernel with Oracle Linux, you can use a real-time profile. Most of these optional packages can be installed from the ol7_optional_latest channel.

Note that real-time profiles have no effect on kernels that are not compiled with real-time support enabled.

To list all of the profiles that are currently available for installation, use the following command

sudo yum list tuned-profiles*

Tuned profiles that are installed on the system by default are stored in the /usr/lib/tuned and /etc/tuned directories. Distribution-specific profiles are stored in the /usr/lib/tuned directory. Note that each profile has its own directory. Each profile directory consists of a main configuration file, tuned.conf, as well as other optional files.

If you want to use a custom profile, copy the profile directory to the /etc/tuned directory, which is where custom profiles are stored. In the event there are two profiles with the same name, the custom profile that is located in /etc/tuned/ is used.

The tuned.conf file can contain one [main] section and additional sections for configuring plugin instances. Note that these sections are optional. For more information about profile configuration, see the tuned.conf(5) manual page.

About the Default Tuned Profiles

A default Tuned profile is automatically selected when you install Oracle Linux. The default profile that is selected is based on the given environment and the performance goals to be achieved in that particular use case. The following default profiles are provided:

  • throughput-performance: Is a profile that is used in an environment where compute nodes are running Oracle Linux. This profile achieves the best throughput performance.

  • virtual-guest: Is a profile that is used in an environment where virtual machines are running Oracle Linux. This profile achieves the best performance. If you are not interested in the best performance, you can change the profile to either the balanced or powersave profile.

  • balanced: Is a profile that is used for other use cases. This profile achieves balanced performance and power consumption.

About Static and Dynamic Tuning in Tuned

Static tuning applies settings that you have defined in the configuration files for sysctl, sysfs, and other system configuration tools throughout the operating system.

You can configure the tuned service to monitor the activity of system components and dynamically tuned system settings, based on information that the service collects about the system and its current running state.

Dynamic tuning can be particularly useful in situations where you need the load on devices like the CPU, hard drives, and network adapters to consume as little power as possible when idle, but require high throughput and low latency when under a high load.

You enable dynamic tuning by setting the correct value in the /etc/tuned/tuned-main.conf settings file, for example:

dynamic_tuning = 1
You must then set the time interval in seconds for tuned to analyze the current system state in the same configuration file so that it can dynamically tune the system, based on the collected results, for example:
update_interval = 10

Installing and Enabling Tuned From the Command Line

The following procedure describes how to install and enable Tuned, install Tuned profiles, and preset a default Tuned profile for your Oracle Linux systems.

  1. If the tuned package is not already installed, install it:

    sudo yum install tuned
  2. Enable and start the tuned service:

    sudo systemctl enable --now tuned
  3. Check the active Tuned profile:

    sudo tuned-adm active
    Current active profile: balanced
  4. Verify that the Tuned profile is applied to the system:

    sudo tuned-adm verify
    Verfication succeeded, current system settings match the preset profile.
    See tuned log file ('/var/log/tuned/tuned.log') for details.

    If a message indicating the current system settings do not match is displayed, try restarting the tuned service:

    sudo systemctl start tuned

Running Tuned in no-daemon Mode

Running tuned in no-daemon mode does not require any resident memory. However, note that when running the service in this mode, tuned does not perform any dynamic tuning. While in no-daemon mode, tuned only applies the settings and then exits.

To run tuned in no-daemon mode, you must set the following value in the /etc/tuned/tuned-main.conf settings file:

daemon = 0

Attention:

Take note that if you decide to run tuned in no-daemon mode, be aware that some functions do not work without running the daemon. In particular, tuned no longer supports D-Bus services or the hot-plug kernel subsystem. Consequently tuned can no longer automatically roll back any settings files that were changed.

Administering the Tuned Service and Tuned Profiles

You administer Tuned by using the tuned-adm command. The following tasks describe how to administer Tuned profiles and the tuned service on your Oracle Linux systems.

For more information, see the tuned-adm(8) and tuned(8) manual pages.

Listing Tuned Profiles

To list all of the available Tuned profiles on a system:

sudo tuned-adm list
Available profiles:
- balanced                    - General non-specialized tuned profile
- desktop                     - Optimize for the desktop use-case
- hpc-compute                 - Optimize for HPC compute workloads
- latency-performance         - Optimize for deterministic performance at the cost of increased power consumption
- network-latency             - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance
- network-throughput          - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks
- powersave                   - Optimize for low power consumption
- throughput-performance      - Broadly applicable tuning that provides excellent performance across a variety of common server workloads
- virtual-guest               - Optimize for running inside a virtual guest
- virtual-host                - Optimize for running KVM guests
Current active profile: throughput-performance

The current active profile is also displayed with this output.

To display just the currently active profile:

sudo tuned-adm active
Current active profile: balanced

Activating a Tuned Profile

Note:

To activate a Tuned profile, the tuned service must be running on your system.

Use the following command to activate a specific selected Tuned profile:

sudo tuned-adm profile profile-name
                  

To have Tuned recommend the profile that is most suitable for your system, use the tuned-adm recommend command:

sudo tuned-adm recommend
virtual-guest

To activate a combination of multiple profiles, use the following command syntax:

sudo tuned-adm profile profile1 profile2
                  

Disabling Tuned

To disable tuning temporarily, use the following command:

sudo tuned-adm off

The previous command disables any tuning settings until you restart the tuned service. When you restart the service, all of the previous tuning settings are re-applied.

You can disable tuning on a more permanent basis by stopping and disabling the tuned service as follows:

sudo systemctl disable --now tuned