Skip to content

Commit

Permalink
more content on tuned global configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
sounix000 committed Jul 29, 2024
1 parent 1b715ca commit 0bec8a0
Showing 1 changed file with 205 additions and 80 deletions.
285 changes: 205 additions & 80 deletions xml/tuning_tuned.xml
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,13 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="cha-tuning-tune
Recommend a profile based on the current system usage.
</para>
<screen>&prompt.sudo;<command>tuned-adm recommend</command></screen>
<para>
By default, &tuned; in &sles; recommends a profile based on the configuration
mentioned in <filename>/usr/lib/tuned/recommend.d/50-tuned.conf</filename>. You can
also define custom recommendation rules by creating the file
<filename>/etc/tuned/recommend.conf</filename>, which takes precedence over the
default rules.
</para>
</listitem>
<listitem>
<para>
Expand Down Expand Up @@ -580,7 +587,119 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="cha-tuning-tune
When &tuned; starts running (as a daemon, by default), the settings in the
<filename>/etc/tuned/tuned-main.conf</filename> global configuration file is applied on the
system. This action prepares the system to apply additional profile-specific tuning in the
subsequent stages. For an overview of the main TuneD configuration file, read its man page:
subsequent stages.
</para>
<para>
The default <filename>tuned-main.conf</filename> file contains the following global
settings:
</para>
<screen>
daemon = 1 <co xml:id="tuned-main-conf-daemon"></co>

dynamic_tuning = 1 <co xml:id="tuned-main-conf-dynamic-tuning"></co>

sleep_interval = 1 <co xml:id="tuned-main-conf-sleep-interval"></co>

update_interval = 10 <co xml:id="tuned-main-conf-update-interval"></co>

recommend_command = 1 <co xml:id="tuned-main-conf-recommend-command"></co>

reapply_sysctl = 1 <co xml:id="tuned-main-conf-reapply-sysctl"></co>

default_instance_priority = 0 <co xml:id="tuned-main-conf-default-instance-priority"></co>

udev_buffer_size = 1MB <co xml:id="tuned-main-conf-udev-buffer-size"></co>

log_file_count = 2 <co xml:id="tuned-main-conf-log-file-count"></co>

log_file_max_size = 1MB <co xml:id="tuned-main-conf-log-file-max-size"></co>
</screen>
<calloutlist>
<callout arearefs="tuned-main-conf-daemon">
<para>
Specifies whether to use the &tuned; daemon. When set to <literal>1</literal>, the
daemon is used, enabling features such as D-Bus integration, settings rollback, hotplug
support, and dynamic tuning. Disabling the daemon by setting it to <literal>0</literal>
is <emphasis>not recommended</emphasis> as it limits TuneD's functionality to static
tuning only.
</para>
</callout>
<callout arearefs="tuned-main-conf-dynamic-tuning">
<para>
Enables or disables dynamic tuning of devices. When set to <literal>1</literal>, TuneD
dynamically adjusts settings based on system activity. When disabled by setting it to
<literal>0</literal>, only static tuning is applied. Since dynamic tuning relies on the
daemon to function, setting <literal>dynamic_tuning=1</literal> becomes irrelevant when
the daemon is disabled by setting it to <literal>daemon=0</literal>.
</para>
</callout>
<callout arearefs="tuned-main-conf-sleep-interval">
<para>
Defines the interval in seconds that the &tuned; daemon sleeps before checking for
events. A higher value reduces overhead but increases response time to changes.
</para>
</callout>
<callout arearefs="tuned-main-conf-update-interval">
<para>
Sets the interval in seconds for updating dynamic tunings. This value must be a
multiple of <literal>sleep_interval</literal>.
</para>
</callout>
<callout arearefs="tuned-main-conf-recommend-command">
<para>
Controls the availability of the <command>tuned-adm recommend</command> command. When
enabled by setting it to <literal>1</literal>, &tuned; parses the custom recommendation
figuration at <filename>/etc/tuned/recommend.conf</filename> or the default
recommendation configuration
<filename>/usr/lib/tuned/recommend.d/50-tuned.conf</filename> and provides profile
recommendations. When disabled by setting it to <literal>0</literal>, the daemon
returns a single hardcoded profile, typically <literal>balanced</literal>.
</para>
</callout>
<callout arearefs="tuned-main-conf-reapply-sysctl">
<para>
Determines whether system sysctl settings from files such as
<filename>/etc/sysctl.conf</filename> and <filename>/etc/sysctl.d</filename> should be
reapplied after TuneD sysctl settings are applied. When enabled by setting to 1, system
sysctls override TuneD sysctls.
</para>
</callout>
<callout arearefs="tuned-main-conf-default-instance-priority">
<para>
Specifies the default priority assigned to TuneD instances. Higher values indicate
higher priority.
</para>
</callout>
<callout arearefs="tuned-main-conf-udev-buffer-size">
<para>
Defines the buffer size for udev events. This setting helps manage the amount of data
processed from udev.
</para>
</callout>
<callout arearefs="tuned-main-conf-log-file-count">
<para>
Sets the number of log files to keep. This helps in log rotation, where older logs are
archived and new logs are created.
</para>
</callout>
<callout arearefs="tuned-main-conf-log-file-max-size">
<para>
Specifies the maximum size of each log file before it is rotated. This prevents log
files from growing indefinitely. For example, when the default log file
<filename>/var/log/tuned/tuned.log</filename> reaches the size set by this parameter, a
new file is started.
</para>
</callout>
</calloutlist>
<warning>
<para>
Modify the values of the global settings in
<filename>/etc/tuned/tuned-main.conf</filename> onnly when you are sure of its effects on
the behaviour of TuneD.
</para>
</warning>
<para>
For a detailed overview of the main TuneD configuration file, read its man page:
</para>
<screen>&prompt.user;<command>man 5 tuned-main.conf</command></screen>
</sect2>
Expand Down Expand Up @@ -637,98 +756,104 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="cha-tuning-tune
custom profile on a production system only if you are sure of its effect.
</para>
</warning>
</sect2>

<sect2 xml:id="sec-tuned-custom-merge-profile">
<title>Creating custom profile by merging configurations</title>
<para>
As a best practice, always merge two or more profiles by manually creating a custom profile
configuration. This approach makes you aware of the exact mix of parameters and plug-ins in
your custom merged profile. It is more involved process compared to applying two or more
profiles simultaneously without checking the result of the merge than gets generated
on-the-fly.
</para>
<para>
As an example, consider a simple merge of the <literal>balanced</literal> and
<literal>powersave</literal> profiles.
</para>
<procedure>
<step>
<para>
Create the path for the custom profile:
</para>
<sect3 xml:id="sec-tuned-custom-merge-profile">
<title>Creating custom profile by merging configurations</title>
<para>
As a best practice, always merge two or more profiles by manually creating a custom
profile configuration. This approach makes you aware of the exact mix of parameters and
plug-ins in your custom merged profile. It is more involved process compared to applying
two or more profiles simultaneously without checking the result of the merge than gets
generated on-the-fly.
</para>
<para>
As an example, consider a simple merge of the <literal>balanced</literal> and
<literal>powersave</literal> profiles.
</para>
<procedure>
<step>
<para>
Create the path for the custom profile:
</para>
<screen>&prompt.sudo;<command>mkdir /etc/tuned/<replaceable>CUSTOM_PROFILE_NAME</replaceable></command></screen>
</step>
<step>
<para>
Create a profile configuration file in this directory:
</para>
</step>
<step>
<para>
Create a profile configuration file in this directory:
</para>
<screen>&prompt.sudo;<command>vi /etc/tuned/<replaceable>CUSTOM_PROFILE_NAME</replaceable>/tuned.conf</command></screen>
</step>
<step>
<para>
Add the following configuration to the file:
</para>
</step>
<step>
<para>
Add the following configuration to the file:
</para>
<screen>
[main]
include=balanced <co xml:id="include-balanced"></co>
[main]
include=balanced <co xml:id="include-balanced"></co>

[cpu] <co xml:id="cpu-settings-override"></co>
governor=powersave
energy_perf_bias=powersave
[cpu] <co xml:id="cpu-settings-override"></co>
governor=powersave
energy_perf_bias=powersave

[disk] <co xml:id="inherit-disk-balanced"></co>
# Inherit settings from balanced profile
[disk] <co xml:id="inherit-disk-balanced"></co>
# Inherit settings from balanced profile

[sysctl]
vm.swappiness=10 <co xml:id="reduce-vm-swappiness"></co>
</screen>
<calloutlist>
<callout arearefs="include-balanced">
<para>
Include the <literal>balanced</literal> profile as a base, which is suitable for
general purpose use.
</para>
</callout>
<callout arearefs="cpu-settings-override">
<para>
Overrides CPU parameters such as <literal>governor</literal> and
<literal>energy-perf-bias</literal> to <literal>powersave</literal>.
</para>
</callout>
<callout arearefs="inherit-disk-balanced">
<para>
Inherit disk settings from the <literal>balanced</literal> profile.
</para>
</callout>
<callout arearefs="reduce-vm-swappiness">
<para>
Add a sysctl parameter to reduce swappiness, which can be beneficial for both
performance and power consumption in certain scenarios.
</para>
</callout>
</calloutlist>
</step>
<step>
<para>
Save the configuration file and exit the text editor.
</para>
</step>
<step>
<para>
Apply the new custom profile after merging certain parameters from
<literal>balanced</literal> and <literal>powersave</literal> profiles.
</para>
[sysctl]
vm.swappiness=10 <co xml:id="reduce-vm-swappiness"></co>
</screen>
<calloutlist>
<callout arearefs="include-balanced">
<para>
Include the <literal>balanced</literal> profile as a base, which is suitable for
general purpose use.
</para>
</callout>
<callout arearefs="cpu-settings-override">
<para>
Overrides CPU parameters such as <literal>governor</literal> and
<literal>energy-perf-bias</literal> to <literal>powersave</literal>.
</para>
</callout>
<callout arearefs="inherit-disk-balanced">
<para>
Inherit disk settings from the <literal>balanced</literal> profile.
</para>
</callout>
<callout arearefs="reduce-vm-swappiness">
<para>
Add a sysctl parameter to reduce swappiness, which can be beneficial for both
performance and power consumption in certain scenarios.
</para>
</callout>
</calloutlist>
</step>
<step>
<para>
Save the configuration file and exit the text editor.
</para>
</step>
<step>
<para>
Apply the new custom profile after merging certain parameters from
<literal>balanced</literal> and <literal>powersave</literal> profiles.
</para>
<screen>&prompt.sudo;<command>tuned-adm profile <replaceable>CUSTOM_PROFILE_NAME</replaceable></command></screen>
</step>
</procedure>
</step>
</procedure>
</sect3>
</sect2>
</sect1>
<sect1 xml:id="sec-tuning-tuned-plugins">
<title>TuneD plug-ins</title>

<para>
Lorem Ipsum
TuneD plug-ins are modular components that extend the functionality of the TuneD system
daemon. These plug-ins allow system administrators to create custom optimization profiles
tailored to specific workloads or hardware configurations. By leveraging several system
metrics and user-defined parameters, TuneD plug-ins can dynamically adjust kernel settings,
CPU frequencies, disk I/O schedulers, and other low-level system parameters to achieve
optimal performance and energy efficiency. While the core &tuned; package includes several
preconfigured profiles, you can extend it through custom plug-ins for fine-grained control
over the system.
</para>
</sect1>
<sect1 xml:id="sec-tuning-extension-scripts">
Expand Down

0 comments on commit 0bec8a0

Please sign in to comment.