1
0
Fork 0
tuned/doc/manual/modules/performance/proc_setting-the-disk-scheduler-using-tuned.adoc
2026-03-03 16:28:26 +01:00

124 lines
3.9 KiB
Text

:_module-type: PROCEDURE
[id="setting-the-disk-scheduler-using-tuned_{context}"]
= Setting the disk scheduler using TuneD
[role="_abstract"]
This procedure creates and enables a *TuneD* profile that sets a given disk scheduler for selected block devices. The setting persists across system reboots.
In the following commands and configuration, replace:
* [replaceable]_device_ with the name of the block device, for example `sdf`
* [replaceable]_selected-scheduler_ with the disk scheduler that you want to set for the device, for example `bfq`
.Prerequisites
ifndef::pantheonenv[]
* The `tuned` service is installed and enabled. For details, see xref:installing-and-enabling-tuned_getting-started-with-tuned[Installing and enabling Tuned]
endif::[]
ifdef::pantheonenv[]
* The `tuned` service is installed and enabled. For details, see xref:modules/performance/proc_installing-and-enabling-tuned.adoc[Installing and enabling Tuned]
endif::[]
.Procedure
ifndef::pantheonenv[]
. Optional: Select an existing *TuneD* profile on which your profile will be based. For a list of available profiles, see xref:tuned-profiles-distributed-with-rhel_getting-started-with-tuned[Tuned profiles distributed with RHEL].
endif::[]
ifdef::pantheonenv[]
. Optional: Select an existing *TuneD* profile on which your profile will be based. For a list of available profiles, see xref:modules/performance/ref_tuned-profiles-distributed-with-rhel.adoc[Tuned profiles distributed with RHEL].
endif::[]
+
To see which profile is currently active, use:
+
----
$ tuned-adm active
----
. Create a new directory to hold your *TuneD* profile:
+
[subs="attributes, quotes"]
----
# mkdir {user-profile-dir}/[replaceable]__my-profile__
----
. Find the system unique identifier of the selected block device:
+
[subs="quotes"]
----
$ udevadm info --query=property --name=/dev/_device_ | grep -E '(WWN|SERIAL)'
ID_WWN=_0x5002538d00000000__
ID_SERIAL=_Generic-_SD_MMC_20120501030900000-0:0_
ID_SERIAL_SHORT=_20120501030900000_
----
+
[NOTE]
====
The command in the this example will return all values identified as a World Wide Name (WWN) or serial number associated with the specified block device. Although it is preferred to use a WWN, the WWN is not always available for a given device and any values returned by the example command are acceptable to use as the _device system unique ID_.
====
. Create the `{user-profile-dir}/[replaceable]_my-profile_/tuned.conf` configuration file. In the file, set the following options:
.. Optional: Include an existing profile:
+
[subs="quotes"]
----
[main]
include=_existing-profile_
----
.. Set the selected disk scheduler for the device that matches the WWN identifier:
+
[subs="quotes"]
----
[disk]
devices_udev_regex=_IDNAME_=_device system unique id_
elevator=_selected-scheduler_
----
+
Here:
* Replace _IDNAME_ with the name of the identifier being used (for example, `ID_WWN`).
* Replace _device system unique id_ with the value of the chosen identifier (for example, `0x5002538d00000000`).
+
To match multiple devices in the `devices_udev_regex` option, enclose the identifiers in parentheses and separate them with vertical bars:
+
[subs="quotes"]
----
devices_udev_regex=(ID_WWN=_0x5002538d00000000_)|(ID_WWN=_0x1234567800000000_)
----
. Enable your profile:
+
[subs="quotes"]
----
# tuned-adm profile [replaceable]__my-profile__
----
.Verification steps
. Verify that the TuneD profile is active and applied:
+
[subs="quotes"]
----
$ tuned-adm active
Current active profile: [replaceable]_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.
----
[role="_additional-resources"]
.Additional resources
ifndef::pantheonenv[]
* xref:customizing-tuned-profiles_tuned-documentation[Customizing Tuned profiles]
endif::[]
ifdef::pantheonenv[]
* xref:assemblies/assembly_customizing-tuned-profiles.adoc[Customizing Tuned Profiles]
endif::[]