Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 2. Optimizing system performance with TuneD


TuneD is a system tuning service designed to optimize system performance and power consumption by using predefined or custom profiles. It includes predefined profiles suited for different workloads, such as high throughput, low latency, and power saving.

2.1. TuneD profiles distributed with RHEL

During installation, TuneD automatically selects the most suitable profile based on the system type. For example, the throughput-performance is selected for compute nodes, virtual-guest for virtual machines, and balanced for general systems. This ensures optimal performance for the environment.

Profiles are divided mainly into two categories:

  • power-saving profiles that reduce power consumption with minimal performance impact, and
  • performance-boosting profiles that optimize system resources for improved speed and responsiveness.

Following is the list of notable profiles distributed with RHEL to select based on the system load:

balanced
It is the default power-saving profile and is intended to be a compromise between performance and power consumption. It uses auto-scaling and auto-tuning whenever possible.
powersave

It is a profile for maximum power saving performance and can throttle the performance to minimize the actual power consumption. It enables USB autosuspend, Wi-Fi power saving, and Aggressive Link Power Management (ALPM) power savings for SATA host adapters. It also schedules multi-core power savings for systems with a low wakeup rate and activates the ondemand governor. It enables AC97 audio power saving or, depending on your system, HDA-Intel power savings with a 10 seconds timeout. If your system contains a supported Radeon graphics card with enabled KMS, the profile configures it to automatic power saving. It changes the energy_performance_preference attribute to the powersave or power energy setting. It also changes the scaling_governor policy attribute to either the ondemand or powersave CPU governor.

Note

In some cases, the balanced profile is more efficient than powersave. For tasks such as video transcoding, running at full power completes the job faster. It also enables the system to enter an idle state and switch to efficient power-saving modes sooner. Throttling the machine reduces power during the task but extends its duration, potentially increasing overall energy use. Thus, the balanced profile is often a better choice.

throughput-performance
A server profile optimized for high throughput that disables power savings mechanisms. It also enables sysctl settings to improve the throughput performance of the disk and network IO.
accelerator-performance
A profile that contains the same tuning as the throughput-performance profile. Additionally, it locks the CPU to low C states so that the latency is less than 100us. This improves the performance of certain accelerators, such as GPUs.
latency-performance
A server profile optimized for low latency and disables power savings mechanisms and enables sysctl settings that improve latency. CPU governor is set to performance and the CPU is locked to the low C states (by PM QoS).
network-latency
A profile for low latency network tuning. It is based on the latency-performance profile. It additionally disables transparent huge pages and NUMA balancing, and tunes several other network-related sysctl parameters.
hpc-compute
A profile optimized for high-performance computing. It is based on the latency-performance profile.
network-throughput
A profile for throughput network tuning. It is based on the throughput-performance profile. It additionally increases kernel network buffers.
virtual-guest
A profile designed for Red Hat Enterprise Linux virtual machines and VMWare guests based on the throughput-performance profile. Among other tasks, it decreases virtual memory swappiness and increases disk readahead values. It does not disable disk barriers.
virtual-host
A profile designed for virtual hosts based on the throughput-performance profile. Among other tasks, it decreases virtual memory swappiness, increases disk readahead values, and enables a more aggressive value of dirty pages writeback.
oracle
A profile optimized for Oracle database loads based on the throughput-performance profile. It additionally disables transparent huge pages and modifies other performance-related kernel parameters. This profile is provided by the tuned-profiles-oracle package.
desktop
A profile optimized for desktops, based on the balanced profile. It additionally enables scheduler autogroups for better response of interactive applications.
optimize-serial-console

A profile that tunes down I/O activity to the serial console by reducing the printk value. This should make the serial console more responsive. This profile is intended to be used as an overlay on other profiles. For example:

# tuned-adm profile throughput-performance optimize-serial-console
mssql
A profile provided for Microsoft SQL Server. It is based on the throughput-performance profile.
intel-sst

A profile optimized for systems with user-defined Intel Speed Select Technology configurations. This profile is intended to be used as an overlay on other profiles. For example:

# tuned-adm profile cpu-partitioning intel-sst
aws

A profile optimized for AWS EC2 instances. It is based on the throughput-performance profile.

For more information about these profiles, see the tuned-profiles man page on your system.

2.2. Real-time TuneD profiles distributed with RHEL

RHEL ships some profiles specifically for systems running the real-time kernel. Without a special kernel build, they do not configure the system to be real-time. On RHEL, the profiles are available with additional repositories.

realtime
Use on bare metal real-time systems. This is provided by the tuned-profiles-realtime package, which is available from the RT or NFV repositories.
realtime-virtual-host
Use in a virtualization host configured for real-time. This is provided by the tuned-profiles-nfv-host package, which is available from the NFV repository.
realtime-virtual-guest
Use in a virtualization guest configured for real-time. This is provided by the tuned-profiles-nfv-guest package, which is available from the NFV repository.

2.3. Installing and enabling TuneD

As a system administrator, use TuneD to optimize the performance profile for a variety of use cases. You must install and enable TuneD to start using it.

After installation, the /usr/lib/tuned/profiles directory stores distribution-specific profiles. Each profile is stored in its own subdirectory. The profile includes the profile configuration file, named tuned.conf and optionally other files, such as helper scripts. Also, to customize a profile, copy the profile directory into /etc/tuned/profiles, which stores the files related to the custom profiles. In cases where profiles with the same name exist, the custom profile located in /etc/tuned/profiles takes precedence.

Prerequisites

  • You have administrative privileges.

Procedure

  1. Install the TuneD package:

    # dnf install tuned
  2. Enable and start the TuneD service:

    # systemctl enable --now tuned
  3. Optional: Install TuneD profiles for real-time systems:

    For the TuneD profiles for real-time systems enable the rhel-10 repository.

    # subscription-manager repos --enable=rhel-10-for-x86_64-nfv-beta-rpms
    # dnf install tuned-profiles-realtime tuned-profiles-nfv

Verification

  • Check the activation status of the profile:

    $ tuned-adm active
    Current active profile: throughput-performance
  • Check if the profile is active and applied:

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

2.4. Managing TuneD profiles

You can manage TuneD profiles in Red Hat Enterprise Linux, including listing available profiles, setting a specific profile, and disabling TuneD when necessary. Proper management of profiles optimizes system performance for specific workloads, such as using the cpu-partitioning profile for low-latency applications.

Prerequisites

  • You have installed and enabled TuneD.
  • You have administrative privileges.

Procedure

  1. List all the available predefined TuneD profiles:

    $ tuned-adm list
  2. Optional: To let TuneD recommend the most suitable profile for your system, use the following command:

    # tuned-adm recommend
    throughput-performance
  3. Activate the profile:

    # tuned-adm profile selected-profile

    Alternatively, you can activate a combination of multiple profiles:

    # tuned-adm profile selected-profile1 selected-profile2
  4. View the current active TuneD profile on your system:

    # tuned-adm active
    Current active profile: selected-profile
  5. Disable all tunings temporarily:

    # tuned-adm off
    The tunings are applied again after the TuneD service restarts.
  6. Optional: Stop and disable the TuneD service permanently:

    # systemctl disable --now tuned

TuneD supports profile inheritance, variable usage, and built-in functions to create new or modify existing profiles efficiently.

The pre-installed and custom profiles are available in the following directories:

  • Pre-installed profiles: Located in /usr/lib/tuned/profiles/
  • Custom profiles: Created in /etc/tuned/profiles/

    Profile Inheritance

    TuneD profiles can inherit settings from other profiles by using the include option in the [main] section. Profile inheritance means Child profiles inherit parent settings, but can override or add parameters for custom requirements. For example, to create a profile based on the balanced profile that additionally sets ALPM to min_power instead of medium_power, use:

    [main]
    include=balanced
    
    [scsi_host]
    alpm=min_power
    Variables’ usage while customizing profiles

    You can define variables while customizing profiles. Variables help to simplify configurations by reducing repetitive definitions. Define your own variables by creating the [variables] section in a profile and by using:

    [variables]
    variable_name=value

    To expand the value of a variable in a profile, use:

    ${variable_name}

    Store the variables in different files and use these variables while customizing profiles by adding the filepath to the variable file. For example, add the following lines to the configuration file to consider variables from the separate file:

    tuned.conf:
    [variables]
    include=/etc/tuned/my-variables.conf
    
    [bootloader]
    cmdline=isolcpus=${isolated_cores}

    Where isolated_cores=1,2 is added in my-variable.conf file as follows:

    my-variable.conf:
    isolated_cores=1,2

2.6. Built-in functions for profile customization

You can use the built-in functions in TuneD profiles to dynamically expand at runtime when a profile is activated. Use built-in functions with TuneD variables to modify and process values dynamically within a profile.

You can extend TuneD with custom functions by creating and integrating custom Python functions as plugins.

Syntax to start a built-in function
${f:function_name:argument_1:argument_2}

To retrieve the directory path where the profile and the tuned.conf file are located, use the PROFILE_DIR variable. It uses the following syntax:

${i:PROFILE_DIR}
Example of isolating CPU cores by using a built-in function
[variables]
non_isolated_cores=0,3-5

[bootloader]
cmdline=isolcpus=${f:cpulist_invert:${non_isolated_cores}}

In this example, the ${non_isolated_cores} variable expands to 0,3-5. The cpulist_invert function inverts the CPU list. On a system with 6 CPUs, 0,3-5 inverts to 1,2, resulting in the kernel booting with the isolcpus=1,2 option.

Expand
Table 2.1. Available built-in functions:
Function nameDescription

assertion

Compare two arguments. If they do not match, the function logs text from the first argument and cancels profile loading.

assertion_non_equal

Compare two arguments. If they match, the function logs text from the first argument and cancels profile loading.

calc_isolated_cores

Calculates and returns isolated cores. The argument specifies how many cores per socket to reserve for housekeeping. If not specified, one core per socket is reserved for housekeeping and the rest are isolated.

check_net_queue_count

Checks whether the user has specified a queue count for net devices. If not, it returns the number of housekeeping CPUs.

cpuinfo_check

Checks regular expressions against /proc/cpuinfo. Accepts arguments in the form: REGEX1, STR1, REGEX2, STR2, …​[, STR_FALLBACK]. If REGEX1 matches something in /proc/cpuinfo, it expands to STR1; if REGEX2 matches, it expands to STR2. It stops on the first match. If no regular expression matches, it expands to STR_FALLBACK or an empty string if no fallback is provided.

cpulist2devs

Converts a CPU list to device strings.

cpulist2hex

Converts a CPU list to a hexadecimal CPU mask.

cpulist2hex_invert

Converts a CPU list to a hexadecimal CPU mask and inverts it.

cpulist_invert

Inverts a list of CPUs to make its complement. For example, on a system with 4 CPUs (0-3), the inversion of the list 0,2,3 is 1.

cpulist_online

Checks whether the CPUs from the list are online. Returns the list containing only online CPUs.

cpulist_pack

Packs a CPU list in the form of 1,2,3,5 to 1-3,5.

cpulist_present

Checks whether the CPUs from the list are present. Returns the list containing only present CPUs.

cpulist_unpack

Unpacks a CPU list in the form of 1-3,4 to 1,2,3,4.

exec

Executes a process and returns its output.

hex2cpulist

Converts a hexadecimal CPU mask to a CPU list.

intel_recommended_pstate

Checks the processor code name and returns the recommended intel_pstate CPUFreq driver mode. "Active" is returned for newer generation processors not in the PROCESSOR_NAME list.

iscpu_check

Checks regular expressions against the output of iscpu. Accepts arguments in the form: REGEX1, STR1, REGEX2, STR2, …​[, STR_FALLBACK]. If REGEX1 matches something in the output, it expands to STR1; if REGEX2 matches, it expands to STR2. It stops on the first match. If no regular expression matches, it expands to STR_FALLBACK or an empty string if no fallback is provided.

package2cpus

Provides a CPU device list for a package (socket).

package2uncores

Provides an uncore device list for a package (socket).

regex_search_ternary

Ternary regular expression operator. Takes arguments in the form: STR1, REGEX, STR2, STR3. If REGEX matches STR1 (re.search is used), STR2 is returned; otherwise, STR3 is returned.

log

Expands to the concatenation of arguments and logs the result, useful for debugging.

kb2s

Converts KB to disk sectors.

s2kb

Converts disk sectors to KB.

strip

Creates a string from all passed arguments and deletes both leading and trailing white spaces.

virt_check

Checks whether TuneD is running inside a virtual machine (VM) or on bare metal. Inside a VM, the function returns the first argument. On bare metal, the function returns the second argument, even in case of an error.

2.7. TuneD plugins

TuneD profiles use plugins to monitor or optimize different devices on the system.

TuneD uses two types of plugins:

Monitoring plugins
Used for gathering system data such as, CPU load, disk I/O, and network traffic. The output of the monitoring plugins can be used by tuning plugins for dynamic tuning. Monitoring plugins are automatically instantiated whenever their metrics are needed by any of the enabled tuning plugins. The available monitoring plugins are:
disk
Gets disk load (number of IO operations) per device and measurement interval.
net
Gets network load (number of transferred packets) per network card and measurement interval.
load
Gets CPU load per CPU and measurement interval.
Tuning plugins
Each tuning plugin tunes an individual subsystem and takes several parameters that are populated from the TuneD profiles. Each subsystem can have multiple devices, such as multiple CPUs or network cards, handled by individual instances of the tuning plugins. Specific settings for individual devices are also supported. The available tuning plugins are:
acpi
Configures the ACPI driver. Use the platform_profile option to set the ACPI platform profile sysfs attribute. It is a generic power/performance preference API for other drivers. Multiple profiles can be specified, separated by |. The first available profile is selected.
audio
Sets the autosuspend timeout for audio codecs to the value specified by the timeout option. Currently, the snd_hda_intel and snd_ac97_codec codecs are supported. The value 0 means that autosuspend is disabled. You can also enforce the controller reset by setting the Boolean option reset_controller to true.
bootloader
Adds options to the kernel command line. This plugin supports only the GRUB boot loader. Customized non-standard location of the GRUB configuration file can be specified by the grub2_cfg_file option. The kernel options are added to the current GRUB configuration and its templates. The system needs to be rebooted for the kernel options to take effect.
cpu
Manages CPU governor and power settings by setting the CPU governor to the value specified by the governor option. It dynamically changes the Power Management Quality of Service (PM QoS) CPU Direct Memory Access (DMA) latency, according to the CPU load.
disk
Manages disk settings such as apm, scheduler_quantum, readahead, readahead_multiply, spindown.
eeepc_she
Dynamically sets the front-side bus (FSB) speed according to the CPU load.
irq
Handles individual interrupt requests (IRQ) as devices and multiple plugin instances can be defined, each addressing different devices or irqs. The device names used by the plugin are irq<n>, where <n> is the IRQ number. The special device DEFAULT controls values written to /proc/irq/default_smp_affinity, which applies to all non-active IRQs.
irqbalance
Manages settings for irqbalance. The plugin configures CPUs which should be skipped when rebalancing IRQs in /etc/sysconfig/irqbalance. It then restarts irqbalance only if it was previously running.
modules
Applies custom kernel modules options. It can set parameters to kernel modules and creates /etc/modprobe.d/tuned.conf file. The syntax is module=option1=value1 option2=value2…​ where module is the module name and optionx=valuex are module options which might be present.
mounts
Enables or disables barriers for mounted filesystems.
net
Configures Wake-on-LAN and interface speed by using the same syntax as the ethtool utility. Also, dynamically changes the interface speed according to the interface utilization.
rtentsk
Avoids inter-processor interruptions caused by enabling or disabling static keys. It has no options. When included, TuneD keeps an open socket with timestamping enabled, thus keeping the static key enabled.
selinux
Tunes SELinux options. SELinux decisions, such as allowing or denying access, are cached. This cache is known as the Access Vector Cache (AVC). When using these cached decisions, SELinux policy rules need to be checked less, which increases performance. The avc_cache_threshold option adjusts the maximum number of AVC entries.
systemd
Tunes systemd options. The cpu_affinity option sets CPU affinity in /etc/systemd/system.conf. This configures the CPU affinity for the service manager and the default CPU affinity for all forked off processes. Add a comma-separated list of CPUs with optional CPU ranges specified by the minus sign (-).
scsi_host
Tunes SCSI host settings (for example, ALPM).
scheduler
Offers a variety of options for the tuning of scheduling priorities, CPU core isolation, and process, thread, and IRQ affinities.
script
Runs external script or binary when loading or unloading a profile.
service
Handles various sysvinit, sysv-rc, openrc, and systemd services specified by the plugin options. Supported service handling commands are start, stop, enable, and disable.
sysctl
Modifies kernel parameters. Use this plugin only if you want to change system settings that are not covered by other plugins available in TuneD. The syntax is name=value, where name is the same as the name provided by the sysctl utility.
sysfs
Sets various sysfs settings specified by the plugin options. The syntax is name=value, where name is the sysfs path to use.
usb
Adjusts USB autosuspend timeout. The value 0 means that autosuspend is disabled.
uncore
Limits the maximum and minimum uncore frequency. The options max_freq_khz, min_freq_khz correspond to sysfs files exposed by Intel uncore frequency driver. Their values can be specified in kHz or as a percentage of their configurable range.
video
Sets various powersave levels on video cards. Currently, only the Radeon cards are supported. The powersave level can be specified by using the radeon_powersave option. Supported values are, default, auto, low, mid, high, dynpm, dpm-battery, dpm-balanced, and dpm-perfomance.
vm
Enables or disables transparent huge pages. Valid values for the transparent_hugepages option are: always, never, madvise.

2.8. Creating a new TuneD profile

You can create a new TuneD profile to customize your requirements for performance optimization.

Prerequisites

Procedure

  1. In the /etc/tuned/profiles directory, create a new directory named the same as the profile that you want to create:

    # mkdir /etc/tuned/profiles/my-profile
  2. In the new directory, create a file named tuned.conf.
  3. Edit the file and add a [main] section and plug in definitions in it, according to your requirements. For example, see the configuration of the balanced profile:

    [main]
    summary=General non-specialized TuneD profile
    
    [cpu]
    governor=conservative
    energy_perf_bias=normal
    
    [audio]
    timeout=10
    
    [video]
    radeon_powersave=dpm-balanced, auto
    
    [scsi_host]
    alpm=medium_power
  4. Activate the profile.

    # tuned-adm profile my-profile

Verification

  • View the profile is active and applied:

    $ tuned-adm active
    Current active profile: my-profile
    $ tuned-adm verify
    Verification succeeded, current system settings match the preset profile. See tuned log file ('/var/log/tuned/tuned.log') for details.

2.9. Modifying an existing TuneD profile

You can modify the parameters of an existing profile to suit your custom requirements. A modified child profile can be created based on an existing TuneD profile.

Prerequisites

Procedure

  1. In the /etc/tuned/profiles directory, create a new directory named the same as the profile that you want to create:

    # mkdir /etc/tuned/profiles/modified-profile
  2. In the new directory, create a file named tuned.conf, and set the [main] section as follows:

    [main]
    include=parent-profile

    Replace parent-profile with the name of the profile you are modifying, for example: throughput-performance

  3. Include your profile modifications. For example, to lower swappiness in the throughput-performance profile, change the value of vm.swappiness to 5, instead of the default 10, use:

    [main]
    include=throughput-performance
    
    [sysctl]
    vm.swappiness=5
  4. Activate the profile.

    # tuned-adm profile modified-profile

Verification

  • View the profile is active and applied:

    $ tuned-adm active
    Current active profile: modified-profile
    $ tuned-adm verify
    Verification succeeded, current system settings match the preset profile. See tuned log file ('/var/log/tuned/tuned.log') for details.

2.10. Enabling TuneD no-daemon mode

You can run TuneD in no-daemon mode, which does not require any resident memory. In this mode, TuneD applies the settings and then exits. However, note that this mode disables certain features, including D-Bus and hot-plug support, and rollback functionality for settings.

Prerequisites

  • You have root privileges or appropriate permissions to modify the system configuration.

Procedure

  1. Edit the /etc/tuned/tuned-main.conf file with the following changes:

    sudo vi /etc/tuned/tuned-main.conf
    daemon = 0
  2. Save and close the file.
  3. Restart the tuned service or reapply or switch profile:

    # systemctl restart tuned
    # tuned-adm profile <tuned_profile>
  4. Verify the tuned status:

    # tuned-adm active
    It seems that tuned daemon is not running, preset profile is not activated.
    Preset profile: <tuned_profile>
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2026 Red Hat
Retour au début