Tuned is a daemon that uses udev to monitor connected devices and statically and dynamically tunes system settings according to a selected profile. It is distributed with a number of predefined profiles for common use cases like high throughput, low latency, or powersave, and allows you to further alter the rules defined for each profile and customize how to tune a particular device. To revert all changes made to the system settings by a certain profile, you can either switch to another profile or deactivate the tuned daemon.
The static tuning mainly consists of the application of predefined sysctl
and sysfs
settings and one-shot activation of several configuration tools like ethtool. Tuned also monitors the use of system components and tunes system settings dynamically based on that monitoring information. Dynamic tuning accounts for the way that various system components are used differently throughout the uptime for any given system. For example, the hard drive is used heavily during startup and login, but is barely used later when the user might mainly work with applications such as web browsers or email clients. Similarly, the CPU and network devices are used differently at different times. Tuned monitors the activity of these components and reacts to the changes in their use.
As a practical example, consider a typical office workstation. Most of the time, the Ethernet network interface will be very inactive. Only a few emails will go in and out every once in a while or some web pages might be loaded. For those kinds of loads, the network interface does not have to run at full speed all the time, as it does by default. Tuned has a monitoring and tuning plugin for network devices that can detect this low activity and then automatically lower the speed of that interface, typically resulting in a lower power usage. If the activity on the interface increases for a longer period of time, for example because a DVD image is being downloaded or an email with a large attachment is opened, tuned detects this and sets the interface speed to maximum to offer the best performance while the activity level is so high. This principle is used for other plugins for CPU and hard disks as well.
In general, tuned uses two types of plugins: monitoring plugins and tuning plugins. Monitoring plugins are used to get information from a running system. Currently, the following monitoring plugins are implemented:
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.
The output of the monitoring plugins can be used by tuning plugins for dynamic tuning. Currently implemented dynamic tuning algorithms try to balance the performance and powersave and are therefore disabled in the performance profiles (dynamic tuning for individual plugins can be enabled or disabled in the tuned profiles). Monitoring plugins are automatically instantiated whenever their metrics are needed by any of the enabled tuning plugins. If two tuning plugins require the same data, only one instance of the monitoring plugin is created and the data is shared.
Each tuning plugin tunes an individual subsystem and takes several parameters that are populated from the
tuned profiles. Each subsystem can have multiple devices (for example, multiple CPUs or network cards) that are handled by individual instances of the tuning plugins. Specific settings for individual devices are also supported. The supplied profiles use wildcards to match all devices of individual subsystems (for details on how to change this, refer to
Section 2.5.4, “Custom Profiles”), which allows the plugins to tune these subsystems according to the required goal (selected profile) and the only thing that the user needs to do is to select the correct
tuned profile (for details on how to select a profile or for a list of supplied profiles, see
Section 2.5.3, “Installation and Usage”). Currently, the following tuning plugins are implemented (only some of these plugins implement dynamic tuning, parameters supported by plugins are also listed):
cpu
Sets the CPU governor to the value specified by the governor
parameter and dynamically changes the PM QoS CPU DMA latency according to the CPU load. If the CPU load is lower than the value specified by the load_threshold
parameter, the latency is set to the value specified by the latency_high
parameter, otherwise it is set to value specified by latency_low
. Also the latency can be forced to a specific value without being dynamically changed further. This can be accomplished by setting the force_latency
parameter to the required latency value.
eeepc_she
Dynamically sets the FSB speed according to the CPU load; this feature can be found on some netbooks and is also known as the Asus Super Hybrid Engine. If the CPU load is lower or equal to the value specified by the load_threshold_powersave
parameter, the plugin sets the FSB speed to the value specified by the she_powersave
parameter (for details about the FSB frequencies and corresponding values, see the kernel documentation, the provided defaults should work for most users). If the CPU load is higher or equal to the value specified by the load_threshold_normal
parameter, it sets the FSB speed to the value specified by the she_normal
parameter. Static tuning is not supported and the plugin is transparently disabled if the hardware support for this feature is not detected.
net
Configures wake-on-lan to the values specified by the wake_on_lan
parameter (it uses same syntax as the ethtool utility). It also dynamically changes the interface speed according to the interface utilization.
sysctl
Sets various sysctl
settings specified by the plugin parameters. The syntax is name
=value
, where name
is the same as the name provided by the sysctl tool. Use this plugin if you need to change settings that are not covered by other plugins (but prefer specific plugins if the settings are covered by them).
usb
Sets autosuspend timeout of USB devices to the value specified by the autosuspend
parameter. The value 0 means that autosuspend is disabled.
vm
Enables or disables transparent huge pages depending on the Boolean value of the transparent_hugepages
parameter.
audio
Sets the autosuspend timeout for audio codecs to the value specified by the timeout
parameter. Currently snd_hda_intel
and snd_ac97_codec
are supported. The value 0
means that the autosuspend is disabled. You can also enforce the controller reset by setting the Boolean parameter reset_controller
to true
.
disk
Sets the elevator to the value specified by the
elevator
parameter. It also sets ALPM to the value specified by the
alpm
parameter (refer to
Section 3.8, “Aggressive Link Power Management”), ASPM to the value specified by the
aspm
parameter (refer to
Section 3.7, “Active-State Power Management”), scheduler quantum to the value specified by the
scheduler_quantum
parameter, disk spindown timeout to the value specified by the
spindown
parameter, disk readahead to the value specified by the
readahead
parameter, and can multiply the current disk readahead value by the constant specified by the
readahead_multiply
parameter. In addition, this plugin dynamically changes the advanced power management and spindown timeout setting for the drive according to the current drive utilization. The dynamic tuning can be controlled by the Boolean parameter
dynamic
and is enabled by default.
mounts
Enables or disables barriers for mounts according to the Boolean value of the disable_barriers
parameter.
script
This plugin can be used for the execution of an external script that is run when the profile is loaded or unloaded. The script is called by one argument which can be start
or stop
(it depends on whether the script is called during the profile load or unload). The script file name can be specified by the script
parameter. Note that you need to correctly implement the stop action in your script and revert all setting you changed during the start action, otherwise the roll-back will not work. For your convenience, the functions
Bash helper script is installed by default and allows you to import and use various functions defined in it. Note that this functionality is provided mainly for backwards compatibility and it is recommended that you use it as the last resort and prefer other plugins if they cover the required settings.
sysfs
Sets various sysfs
settings specified by the plugin parameters. The syntax is name
=value
, where name
is the sysfs
path to use. Use this plugin in case you need to change some settings that are not covered by other plugins (please prefer specific plugins if they cover the required settings).
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
parameter. Supported values are:
default
,
auto
,
low
,
mid
,
high
, and
dynpm
. For details, refer to
http://www.x.org/wiki/RadeonFeature#KMS_Power_Management_Options. Note that this plugin is experimental and the parameter may change in the future releases.