In this best practice, we changed the default Linux disk I/O scheduler per Red Hat guidelines.
Overview
There are several choices for the type of disk scheduler used by the operating system for Red Hat Enterprise Linux 8. The function of the disk scheduler is for ordering, delaying, or merging I/O requests to storage to achieve better throughput and latency. Each disk scheduler provides a different method for managing storage requests:
- None: Implements a first-in first-out (FIFO) scheduling algorithm. The none scheduler is recommended for systems that have high performance storage like Solid State Drives (SSD) or Non-volatile Memory Express (NVMe) drives. The default schedule for NVME is none.
- Mq-deadline: This scheduler groups queued I/O requests into batches. The I/O in the batches are organized by logical block addressing so that writes are organized by location to storage. The mq-deadline is suited for traditional HDD storage.
- Bfq: This scheduler prioritizes latency rather than maximum throughput. The bfq disk scheduler is recommended for desktop or interactive tasks and traditional HDD storage.
- Kyber: This scheduler tunes itself by analyzing I/O requests. With each I/O request a calculation is done to determine of the I/O can be satisfied with the least amount of latency. Kyber is recommended for high performance storage like SSDs and NVMe drives.
In this best practice, we followed Red Hat’s recommendation to set the disk I/O scheduler to none, as the PowerStore contains NVMe drives and the database access the storage volumes as virtual devices through virtual guest operating system and through host bus adapters (HBAs).
Implementation steps
Use the following steps to set disk I/O scheduler using tuned:
- Find the system unique identifier of the selected block device. Substitute the word “device” in the command below with the device name (ex. sdc).
$ udevadm info --query=property --name=/dev/device | grep -E '(WWN|SERIAL)'
- Use a device name such as sdc to in “–name = /dev/sdc”
- Create the /etc/tuned/my-profile/tuned.conf configuration file.
[main]
Include= existing-profile
[disk]
devices_udev_regex=ID_WWN=device system unique id
elevator=selected-scheduler
- Replace device system unique id with the value of the chosen identifier (for example,
0x6000c2982a4e742c for /dev/sdc).
- To match multiple devices in the devices_udev_regex option, enclose the identifiers in parentheses and separate them with vertical bars. For example, if we have ID_WWN =0x6000c297fc627d0f for /dev/sdd and ID_WWN= 0x6000c2982a4e742c for /dev/sdf, the UDEV entry should look like this:
devices_udev_regex=(ID_WWN=0x6000c297fc627d0f)|(ID_WWN0x6000c2982a4e742c)
elevator=none
- Enable your profile.
# tuned-adm profile my-profile
- Verify that the Tuned profile is active and applied:
$ tuned-adm active
$ tuned-adm verify
Additional resources
Red Hat Enterprise Linux 8: Monitoring and managing system status and performance